From 23148dba93fa4e381dcb48be03a660c9c5d060c7 Mon Sep 17 00:00:00 2001 From: Sunxyw Date: Fri, 24 Nov 2023 18:41:53 +0800 Subject: [PATCH] feat: add user indicator to header --- src/lib/shared/layout/header/Header.svelte | 3 ++ .../layout/header/MobileNavigation.svelte | 3 ++ src/lib/shared/layout/header/UserClip.svelte | 44 +++++++++++++++++++ .../ui/avatar/avatar-fallback.svelte | 17 +++++++ .../components/ui/avatar/avatar-image.svelte | 19 ++++++++ .../vgui/components/ui/avatar/avatar.svelte | 19 ++++++++ src/lib/vgui/components/ui/avatar/index.ts | 13 ++++++ 7 files changed, 118 insertions(+) create mode 100644 src/lib/shared/layout/header/UserClip.svelte create mode 100644 src/lib/vgui/components/ui/avatar/avatar-fallback.svelte create mode 100644 src/lib/vgui/components/ui/avatar/avatar-image.svelte create mode 100644 src/lib/vgui/components/ui/avatar/avatar.svelte create mode 100644 src/lib/vgui/components/ui/avatar/index.ts diff --git a/src/lib/shared/layout/header/Header.svelte b/src/lib/shared/layout/header/Header.svelte index 76c3073..f2246f0 100644 --- a/src/lib/shared/layout/header/Header.svelte +++ b/src/lib/shared/layout/header/Header.svelte @@ -1,4 +1,5 @@ + +{#await userFunc} + +{:then user} + +{:catch error} + +{/await} diff --git a/src/lib/vgui/components/ui/avatar/avatar-fallback.svelte b/src/lib/vgui/components/ui/avatar/avatar-fallback.svelte new file mode 100644 index 0000000..6dc11ee --- /dev/null +++ b/src/lib/vgui/components/ui/avatar/avatar-fallback.svelte @@ -0,0 +1,17 @@ + + + + + diff --git a/src/lib/vgui/components/ui/avatar/avatar-image.svelte b/src/lib/vgui/components/ui/avatar/avatar-image.svelte new file mode 100644 index 0000000..6bbf0f6 --- /dev/null +++ b/src/lib/vgui/components/ui/avatar/avatar-image.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/lib/vgui/components/ui/avatar/avatar.svelte b/src/lib/vgui/components/ui/avatar/avatar.svelte new file mode 100644 index 0000000..6781875 --- /dev/null +++ b/src/lib/vgui/components/ui/avatar/avatar.svelte @@ -0,0 +1,19 @@ + + + + + diff --git a/src/lib/vgui/components/ui/avatar/index.ts b/src/lib/vgui/components/ui/avatar/index.ts new file mode 100644 index 0000000..6b114c1 --- /dev/null +++ b/src/lib/vgui/components/ui/avatar/index.ts @@ -0,0 +1,13 @@ +import Fallback from './avatar-fallback.svelte'; +import Image from './avatar-image.svelte'; +import Root from './avatar.svelte'; + +export { + Root, + Image, + Fallback, + // + Root as Avatar, + Image as AvatarImage, + Fallback as AvatarFallback +};