WIP V improve UX [snapshot task 2]
This commit is contained in:
1 parent
5f8c6a1916
commit
a73b3075b6
16 files changed
+238
-232
No files matched your search
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import TransferPanel from './TransferPanel.vue';
|
||||
import type { SavedConnection, ConnectionActivity } from '../lib/connections.ts';
|
||||
const props = defineProps<{ connection: SavedConnection }>();
|
||||
import type { SavedConnection, ConnectionActivity, ConnectionUpdate } from '../lib/connections.ts';
|
||||
const props = defineProps<{ connection: SavedConnection; loadTrust: (id: string) => Promise<SavedConnection> }>();
|
||||
const emit = defineEmits<{
|
||||
status: [id: string, state: 'ready' | 'connecting' | 'connected'];
|
||||
activity: [id: string, item: ConnectionActivity];
|
||||
paired: [id: string, key: string];
|
||||
update: [id: string, change: ConnectionUpdate];
|
||||
}>();
|
||||
const mode = ref<'send' | 'receive'>('send');
|
||||
const sessionActive = ref(false), connected = ref(false);
|
||||
@@ -35,9 +35,9 @@ function sizeLabel(size: number) {
|
||||
<button :disabled="sessionActive && !connected" :class="{ active: (connected ? direction : mode) === 'send' }" :aria-pressed="(connected ? direction : mode) === 'send'" @click="navigate('send')">Send</button>
|
||||
<button :disabled="sessionActive && !connected" :class="{ active: (connected ? direction : mode) === 'receive' }" :aria-pressed="(connected ? direction : mode) === 'receive'" @click="navigate('receive')">Receive</button>
|
||||
</div>
|
||||
<TransferPanel ref="panel" :key="mode" :sending="mode === 'send'" :preferred-device="connection.peerKey"
|
||||
<TransferPanel ref="panel" :key="mode" :sending="mode === 'send'" :connection="connection" :load-trust="() => loadTrust(connection.id)"
|
||||
@session-change="sessionActive = $event; status()" @connected-change="connected = $event; direction = mode; status()"
|
||||
@activity="emit('activity', connection.id, $event)" @paired="emit('paired', connection.id, $event)" />
|
||||
@activity="emit('activity', connection.id, $event)" @update="emit('update', connection.id, $event)" />
|
||||
</div>
|
||||
<aside class="activity-panel" aria-labelledby="activity-heading">
|
||||
<div class="activity-heading"><h2 id="activity-heading">Activity</h2><span>{{ connection.history.length }}</span></div>
|
||||
|
||||
Reference in new issue
Block a user