tiny UI imrovments
This commit is contained in:
@@ -11,38 +11,28 @@
|
|||||||
<span class="status-led" [class.status-led-ok]="indicatorTone(session.signalingState()) === 'ok'" [class.status-led-connecting]="indicatorTone(session.signalingState()) === 'connecting'" [class.status-led-offline]="indicatorTone(session.signalingState()) === 'offline'"></span>
|
<span class="status-led" [class.status-led-ok]="indicatorTone(session.signalingState()) === 'ok'" [class.status-led-connecting]="indicatorTone(session.signalingState()) === 'connecting'" [class.status-led-offline]="indicatorTone(session.signalingState()) === 'offline'"></span>
|
||||||
<span>Signaling</span>
|
<span>Signaling</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="status-indicator">
|
<button
|
||||||
|
class="status-indicator status-indicator-action"
|
||||||
|
type="button"
|
||||||
|
[disabled]="!canReconnectWebRtc()"
|
||||||
|
[attr.aria-label]="canReconnectWebRtc() ? 'Open WebRTC channel' : 'WebRTC channel status'"
|
||||||
|
[title]="canReconnectWebRtc() ? 'Open WebRTC channel' : 'WebRTC channel status'"
|
||||||
|
(click)="ensureConnection()"
|
||||||
|
>
|
||||||
<span class="status-led" [class.status-led-ok]="indicatorTone(webRtcState()) === 'ok'" [class.status-led-connecting]="indicatorTone(webRtcState()) === 'connecting'" [class.status-led-offline]="indicatorTone(webRtcState()) === 'offline'"></span>
|
<span class="status-led" [class.status-led-ok]="indicatorTone(webRtcState()) === 'ok'" [class.status-led-connecting]="indicatorTone(webRtcState()) === 'connecting'" [class.status-led-offline]="indicatorTone(webRtcState()) === 'offline'"></span>
|
||||||
<span>WebRTC</span>
|
<span>WebRTC</span>
|
||||||
</div>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
} @else {
|
} @else {
|
||||||
<h1 class="h3 mb-1 mt-2">Not signed in</h1>
|
<h1 class="h3 mb-1 mt-2">Not signed in</h1>
|
||||||
<p class="small text-secondary mb-0">Return to the dashboard and sign in again.</p>
|
<p class="small text-secondary mb-0">Return to the dashboard and sign in again.</p>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (peer(); as selectedPeer) {
|
|
||||||
<button
|
|
||||||
class="btn btn-outline-light"
|
|
||||||
type="button"
|
|
||||||
[disabled]="selectedPeer.channelState === 'open'"
|
|
||||||
(click)="ensureConnection()"
|
|
||||||
>
|
|
||||||
{{ selectedPeer.channelState === 'open' ? 'Connected' : 'Open channel' }}
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="chat-layout">
|
<div class="chat-layout">
|
||||||
<aside class="peer-sidebar">
|
<aside class="peer-sidebar">
|
||||||
<div class="d-flex justify-content-between align-items-start gap-3 mb-3">
|
|
||||||
<div>
|
|
||||||
<h2 class="h5 mb-1">Connected peers</h2>
|
|
||||||
<p class="small text-secondary mb-0">Switch between active direct chats.</p>
|
|
||||||
</div>
|
|
||||||
<span class="peer-count">{{ session.peers().length }}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="peer-list">
|
<div class="peer-list">
|
||||||
@if (session.peers().length === 0) {
|
@if (session.peers().length === 0) {
|
||||||
|
|||||||
@@ -35,6 +35,27 @@
|
|||||||
color: var(--page-text-soft);
|
color: var(--page-text-soft);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status-indicator-action {
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-indicator-action:not(:disabled) {
|
||||||
|
color: var(--page-text);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-indicator-action:not(:disabled):hover,
|
||||||
|
.status-indicator-action:not(:disabled):focus-visible {
|
||||||
|
color: var(--accent-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-indicator-action:disabled {
|
||||||
|
cursor: default;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.status-led {
|
.status-led {
|
||||||
width: 0.8rem;
|
width: 0.8rem;
|
||||||
height: 0.8rem;
|
height: 0.8rem;
|
||||||
@@ -151,6 +172,7 @@
|
|||||||
.conversation {
|
.conversation {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0.85rem;
|
gap: 0.85rem;
|
||||||
|
align-content: start;
|
||||||
min-height: 24rem;
|
min-height: 24rem;
|
||||||
max-height: calc(100dvh - 20rem);
|
max-height: calc(100dvh - 20rem);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
@@ -159,6 +181,7 @@
|
|||||||
|
|
||||||
.bubble {
|
.bubble {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
align-self: start;
|
||||||
max-width: min(75%, 34rem);
|
max-width: min(75%, 34rem);
|
||||||
padding: 0.9rem 1rem;
|
padding: 0.9rem 1rem;
|
||||||
border-radius: 1.2rem;
|
border-radius: 1.2rem;
|
||||||
|
|||||||
@@ -140,6 +140,10 @@ export class ChatPageComponent {
|
|||||||
return 'offline';
|
return 'offline';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
canReconnectWebRtc(): boolean {
|
||||||
|
return this.indicatorTone(this.webRtcState()) === 'offline';
|
||||||
|
}
|
||||||
|
|
||||||
async switchPeer(peerId: string): Promise<void> {
|
async switchPeer(peerId: string): Promise<void> {
|
||||||
if (!peerId || peerId === this.peerId()) {
|
if (!peerId || peerId === this.peerId()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user