frontend: add "connecting" indicator

This commit is contained in:
hippoz 2022-04-24 21:29:25 +03:00
parent 9122434a36
commit a5ade22483
No known key found for this signature in database
GPG key ID: 7C52899193467641
5 changed files with 28 additions and 32 deletions

View file

@ -47,10 +47,17 @@
body { body {
color: var(--foreground-color-1); color: var(--foreground-color-1);
background-color: var(--background-color-1);
font-size: 100%; font-size: 100%;
font-family: "Iosevka Aile Web", sans-serif; font-family: "Iosevka Aile Web", sans-serif;
font-weight: 400; font-weight: 400;
line-height: 1.75; line-height: 1.75;
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
overflow: hidden;
} }
.pre--loading-screen { .pre--loading-screen {
@ -77,6 +84,10 @@ body {
flex-shrink: 0; flex-shrink: 0;
} }
.top-bar-heading {
margin-left: var(--space-xxs);
}
.h1 { .h1 {
font-size: 2.488rem; font-size: 2.488rem;
} }

View file

@ -4,13 +4,7 @@
export let channel; export let channel;
</script> </script>
<style>
.channel-heading {
margin-left: var(--space-xxs);
}
</style>
<div class="top-bar"> <div class="top-bar">
<HashIcon /> <HashIcon />
<span class="h5 channel-heading">{ channel.name }</span> <span class="h5 top-bar-heading">{ channel.name }</span>
</div> </div>

View file

@ -1,4 +1,5 @@
<script> <script>
import { CloudIcon } from "svelte-feather-icons";
import { gatewayStatus, selectedChannel } from "../../../stores"; import { gatewayStatus, selectedChannel } from "../../../stores";
import ChannelView from "./ChannelView.svelte"; import ChannelView from "./ChannelView.svelte";
import Sidebar from "./Sidebar.svelte"; import Sidebar from "./Sidebar.svelte";
@ -6,8 +7,8 @@
<style> <style>
.flex-container { .flex-container {
width: 100vw; width: 100%;
height: 100vh; height: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
overflow: hidden; overflow: hidden;
@ -24,8 +25,14 @@
} }
</style> </style>
{#if !$gatewayStatus.ready}
<div class="top-bar">
<CloudIcon />
<span class="h5 top-bar-heading">connecting...</span>
</div>
{/if}
<div class="flex-container"> <div class="flex-container">
{#if $gatewayStatus.ready}
<Sidebar /> <Sidebar />
{#if $selectedChannel.id === -1} {#if $selectedChannel.id === -1}
<div class="fullscreen-message"> <div class="fullscreen-message">
@ -34,9 +41,4 @@
{:else} {:else}
<ChannelView channel={$selectedChannel} /> <ChannelView channel={$selectedChannel} />
{/if} {/if}
{:else}
<div class="fullscreen-message">
connecting...
</div>
{/if}
</div> </div>

View file

@ -3,13 +3,7 @@
import { userInfoStore } from "../../../stores"; import { userInfoStore } from "../../../stores";
</script> </script>
<style>
.user-heading {
margin-left: var(--space-xxs);
}
</style>
<div class="top-bar"> <div class="top-bar">
<AtSignIcon /> <AtSignIcon />
<span class="h5 user-heading">{ $userInfoStore.username }</span> <span class="h5 top-bar-heading">{ $userInfoStore ? $userInfoStore.username : "" }</span>
</div> </div>

View file

@ -93,11 +93,6 @@ class UserInfoStore extends Store {
this.value = user; this.value = user;
this.updated(); this.updated();
}); });
gateway.subscribe(GatewayEventType.Close, () => {
this.value = null;
this.updated();
});
} }
} }