From 55a047ab739e71767722c227d3d8ff97f81a77c7 Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Tue, 1 Aug 2023 10:43:36 -0700 Subject: [PATCH 01/10] misc: add basic auth system --- src/lib/auth.ts | 128 ++++++++++++++++++++++++++++++++++ src/routes/login/+page.svelte | 9 +-- 2 files changed, 131 insertions(+), 6 deletions(-) create mode 100644 src/lib/auth.ts diff --git a/src/lib/auth.ts b/src/lib/auth.ts new file mode 100644 index 00000000..ae3dad47 --- /dev/null +++ b/src/lib/auth.ts @@ -0,0 +1,128 @@ +import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js' +import { DEFAULT_INSTANCE_URL, getClient } from '$lib/lemmy.js' +import type { MyUserInfo } from 'lemmy-js-client' +import { get, writable } from 'svelte/store' + +function getFromStorage(key: string): T | undefined { + const lc = localStorage.getItem(key) + if (!lc) return undefined + + return JSON.parse(lc) +} + +function setFromStorage(key: string, item: any) { + return localStorage.setItem(key, JSON.stringify(item)) +} + +interface Profile { + id: number + instance: string + jwt?: string + user?: PersonData +} + +/** + * What gets stored in localstorage. + */ +interface ProfileData { + profiles: Profile[] + profile: number +} + +interface PersonData extends MyUserInfo { + unreads: number + reports: number +} + +export const profileData = writable({ profiles: [], profile: -1 }) +export const profile = writable({ + id: -1, + instance: DEFAULT_INSTANCE_URL, +}) + +profileData.subscribe((pd) => { + setFromStorage('profileData', pd) +}) + +profile.subscribe(async (p) => { + if (!p || !p.jwt) { + profileData.update((pd) => ({ ...pd, profile: -1 })) + return + } + if (p.user) return + + // fetch the user because p.user is undefined + const user = await userFromJwt(p.jwt, p.instance) + + p = { + ...p, + user: user, + } +}) + +export async function setUser(jwt: string, instance: string) { + try { + new URL(`https://${instance}`) + } catch (err) { + return + } + + const user = await userFromJwt(jwt, instance) + if (!user) { + toast({ + content: 'Failed to fetch your user. Is your instance down?', + type: ToastType.error, + }) + } + + profileData.update((pd) => { + // too lazy to make a decent system + const id = Math.floor(Math.random() * 100000) + + const newProfile: Profile = { + id: id, + instance: instance, + jwt: jwt, + } + + profile.set({ + ...newProfile, + user: user, + }) + + return { + profile: id, + profiles: [...pd.profiles, newProfile], + } + }) +} + +async function userFromJwt( + jwt: string, + instance: string +): Promise { + const myUser = (await getClient(instance).getSite({ auth: jwt })).my_user + if (!myUser) return undefined + + return { + unreads: 0, + reports: 0, + ...myUser, + } +} + +const userToPersonData = (user: MyUserInfo): PersonData => ({ + ...user, + unreads: 0, + reports: 0, +}) + +function getProfileData() { + const pd = getFromStorage('profileData')! + + profileData.set(pd) + + console.log(get(profileData)) +} + +getProfileData() diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index 858c89d1..8a838828 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -1,5 +1,6 @@ + +
    + +
diff --git a/src/lib/components/ui/list/EditableListItem.svelte b/src/lib/components/ui/list/EditableListItem.svelte new file mode 100644 index 00000000..f4331ef0 --- /dev/null +++ b/src/lib/components/ui/list/EditableListItem.svelte @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/routes/accounts/+page.svelte b/src/routes/accounts/+page.svelte new file mode 100644 index 00000000..85ebf03f --- /dev/null +++ b/src/routes/accounts/+page.svelte @@ -0,0 +1,88 @@ + + +{#if $profileData.profiles.length == 0} +
+
+
+ +

No accounts

+
+ +
+
+{:else} +
+
+

Accounts

+ +
+ { + deleteProfile(id.detail) + }} + let:action + > + {#each $profileData.profiles as profile (profile.id)} +
+
+ {profile.username} + + {profile.instance} + +
+
+ + +
+ {/each} + + +
+{/if} diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index 8a838828..66c45883 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -41,7 +41,7 @@ }) if (response?.jwt) { - setUser(response.jwt, data.instance) + setUser(response.jwt, data.instance, data.username) toast({ content: 'Successfully logged in.', type: ToastType.success }) goto('/') From 2da415b670a46a30fe833f4ba4ef0687e85cf70a Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Tue, 1 Aug 2023 13:00:06 -0700 Subject: [PATCH 04/10] feat: switch to new account system --- src/lib/auth.ts | 25 +++-- .../components/lemmy/comment/Comment.svelte | 11 +-- .../lemmy/comment/CommentActions.svelte | 21 +++-- .../lemmy/comment/CommentForm.svelte | 7 +- .../lemmy/comment/CommentVote.svelte | 11 ++- .../components/lemmy/comment/Comments.svelte | 7 +- .../lemmy/community/CommunityCard.svelte | 14 +-- .../lemmy/moderation/BanModal.svelte | 7 +- .../moderation/CommentModerationMenu.svelte | 5 +- .../lemmy/moderation/ModerationMenu.svelte | 20 ++-- .../lemmy/moderation/RemoveModal.svelte | 9 +- .../lemmy/moderation/ReportModal.svelte | 9 +- .../components/lemmy/post/PostActions.svelte | 23 ++--- src/lib/components/lemmy/post/PostForm.svelte | 16 ++-- src/lib/components/lemmy/post/PostVote.svelte | 11 ++- src/lib/components/ui/Navbar.svelte | 45 ++++----- src/lib/components/ui/Sidebar.svelte | 16 +++- src/lib/lemmy.ts | 92 +------------------ src/lib/lemmy/user.ts | 5 +- src/routes/+page.svelte | 4 +- src/routes/+page.ts | 5 +- src/routes/c/[name]/+page.ts | 7 +- src/routes/communities/+page.ts | 7 +- src/routes/communities/Subscribe.svelte | 12 +-- src/routes/create/post/+page.svelte | 4 +- src/routes/inbox/+page.svelte | 9 +- src/routes/inbox/+page.ts | 9 +- src/routes/inbox/InboxItem.svelte | 15 ++- src/routes/login/+page.svelte | 3 - src/routes/moderation/+page.ts | 7 +- src/routes/moderation/Report.svelte | 14 +-- src/routes/post/[instance]/[id]/+page.svelte | 28 ++---- src/routes/post/[instance]/[id]/+page.ts | 7 +- src/routes/saved/+page.ts | 9 +- src/routes/search/+page.ts | 5 +- src/routes/settings/+page.svelte | 53 ----------- src/routes/u/[name]/+page.svelte | 27 +++--- src/routes/u/[name]/+page.ts | 5 +- 38 files changed, 222 insertions(+), 362 deletions(-) diff --git a/src/lib/auth.ts b/src/lib/auth.ts index ee0db380..8962f2c8 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -1,9 +1,15 @@ +import { env } from '$env/dynamic/public' import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js' -import { DEFAULT_INSTANCE_URL, getClient, instance } from '$lib/lemmy.js' +import { getClient, instance } from '$lib/lemmy.js' +import { userSettings } from '$lib/settings.js' import type { MyUserInfo } from 'lemmy-js-client' import { get, writable } from 'svelte/store' +const LINKED_INSTANCE_URL = env.PUBLIC_INSTANCE_URL +const DEFAULT_INSTANCE_URL = env.PUBLIC_INSTANCE_URL || 'lemmy.ml' + function getFromStorage(key: string): T | undefined { + if (typeof localStorage == 'undefined') return undefined const lc = localStorage.getItem(key) if (!lc) return undefined @@ -11,6 +17,7 @@ function getFromStorage(key: string): T | undefined { } function setFromStorage(key: string, item: any) { + if (typeof localStorage == 'undefined') return return localStorage.setItem(key, JSON.stringify(item)) } @@ -46,15 +53,13 @@ profileData.subscribe((pd) => { export const profile = writable(getProfile()) profile.subscribe(async (p) => { - if (p?.instance) { - instance.set(p.instance) - } if (!p || !p.jwt) { profileData.update((pd) => ({ ...pd, profile: -1 })) return } if (p.user) return + instance.set(p.instance) // fetch the user because p.user is undefined const user = await userFromJwt(p.jwt, p.instance) @@ -134,11 +139,13 @@ function getProfile() { return pd.profiles.find((p) => p.id == id) } +const getDefaultProfile = () => ({ + id: -1, + instance: get(instance), +}) + export function resetProfile() { - profile.set({ - id: -1, - instance: DEFAULT_INSTANCE_URL, - }) + profile.set(getDefaultProfile()) profileData.update((p) => ({ ...p, profile: -1 })) } @@ -168,7 +175,7 @@ export function setUserID(id: number) { } const prof = pd.profiles.find((p) => p.id == id) - profile.set(prof) + profile.set(prof ?? getDefaultProfile()) profileData.update((p) => ({ ...p, profile: id })) return prof diff --git a/src/lib/components/lemmy/comment/Comment.svelte b/src/lib/components/lemmy/comment/Comment.svelte index 7b232e74..43a8ac85 100644 --- a/src/lib/components/lemmy/comment/Comment.svelte +++ b/src/lib/components/lemmy/comment/Comment.svelte @@ -11,16 +11,13 @@ import type { CommentNodeI } from './comments' import RelativeDate from '$lib/components/util/RelativeDate.svelte' import CommentForm from './CommentForm.svelte' - import { page } from '$app/stores' import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte' import CommentActions from '$lib/components/lemmy/comment/CommentActions.svelte' - import { createEventDispatcher, getContext } from 'svelte' - import type { CommentView } from 'lemmy-js-client' import Modal from '$lib/components/ui/modal/Modal.svelte' - import { authData, getClient } from '$lib/lemmy.js' + import { getClient } from '$lib/lemmy.js' import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js' - import TextArea from '$lib/components/input/TextArea.svelte' + import { profile } from '$lib/auth.js' export let node: CommentNodeI export let postId: number @@ -39,11 +36,11 @@ bind:open={editing} action="Save" on:action={async () => { - if (!$authData || newComment.length <= 0) return + if (!$profile?.jwt || newComment.length <= 0) return try { await getClient().editComment({ - auth: $authData.token, + auth: $profile.jwt, comment_id: node.comment_view.comment.id, content: newComment, }) diff --git a/src/lib/components/lemmy/comment/CommentActions.svelte b/src/lib/components/lemmy/comment/CommentActions.svelte index c1869126..fd68a953 100644 --- a/src/lib/components/lemmy/comment/CommentActions.svelte +++ b/src/lib/components/lemmy/comment/CommentActions.svelte @@ -15,7 +15,7 @@ PencilSquare, Trash, } from 'svelte-hero-icons' - import { authData, getClient, user } from '$lib/lemmy.js' + import { getClient } from '$lib/lemmy.js' import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js' import Menu from '$lib/components/ui/menu/Menu.svelte' import MenuButton from '$lib/components/ui/menu/MenuButton.svelte' @@ -25,12 +25,13 @@ import { amMod, report } from '$lib/components/lemmy/moderation/moderation.js' import ModerationMenu from '$lib/components/lemmy/moderation/ModerationMenu.svelte' import CommentModerationMenu from '$lib/components/lemmy/moderation/CommentModerationMenu.svelte' + import { profile } from '$lib/auth.js' export let comment: CommentView export let replying: boolean = false async function save() { - if (!$authData) return + if (!$profile?.jwt) return const saved = comment.saved @@ -38,7 +39,7 @@ try { await getClient().saveComment({ - auth: $authData.token, + auth: $profile.jwt, comment_id: comment.comment.id, save: !saved, }) @@ -70,7 +71,7 @@ Reply - {#if $user && amMod($user, comment.community)} + {#if $profile?.user && amMod($profile?.user, comment.community)} {/if} Comment actions - {#if $authData?.token} - {#if comment.creator.id == $user?.local_user_view.person.id} + {#if $profile?.jwt} + {#if comment.creator.id == $profile.user?.local_user_view.person.id} dispatcher('edit', comment)}> Edit @@ -100,14 +101,14 @@ {comment.saved ? 'Unsave' : 'Save'} - {#if $user && $authData && isCommentMutable(comment, $user.local_user_view)} + {#if $profile?.user && $profile.jwt && isCommentMutable(comment, $profile.user.local_user_view)} { - if (!$authData) return + if (!$profile?.jwt) return try { await getClient().deleteComment({ - auth: $authData.token, + auth: $profile.jwt, comment_id: comment.comment.id, deleted: true, }) @@ -127,7 +128,7 @@ Delete {/if} - {#if $authData && $user?.local_user_view.person.id != comment.creator.id} + {#if $profile.jwt && $profile.user?.local_user_view.person.id != comment.creator.id} report(comment)} color="dangerSecondary"> Report diff --git a/src/lib/components/lemmy/comment/CommentForm.svelte b/src/lib/components/lemmy/comment/CommentForm.svelte index 4c034af7..4cae2c10 100644 --- a/src/lib/components/lemmy/comment/CommentForm.svelte +++ b/src/lib/components/lemmy/comment/CommentForm.svelte @@ -2,12 +2,13 @@ import Button from '$lib/components/input/Button.svelte' import { Color } from '$lib/ui/colors.js' import type { CommentResponse } from 'lemmy-js-client' - import { authData, getClient, user } from '$lib/lemmy.js' + import { getClient } from '$lib/lemmy.js' import { createEventDispatcher } from 'svelte' import { ToastType, addToast } from '$lib/components/ui/toasts/toasts.js' import TextArea from '$lib/components/input/TextArea.svelte' import MultiSelect from '$lib/components/input/MultiSelect.svelte' import Markdown from '$lib/components/markdown/Markdown.svelte' + import { profile } from '$lib/auth.js' export let postId: number export let parentId: number | undefined = undefined @@ -25,13 +26,13 @@ let preview = false async function submit() { - if (!$user || !$authData || value == '') return + if (!$profile?.user || !$profile?.jwt || value == '') return loading = true try { const response = await getClient().createComment({ - auth: $authData.token, + auth: $profile.jwt, content: value, post_id: postId, parent_id: parentId, diff --git a/src/lib/components/lemmy/comment/CommentVote.svelte b/src/lib/components/lemmy/comment/CommentVote.svelte index 509c3741..e454067c 100644 --- a/src/lib/components/lemmy/comment/CommentVote.svelte +++ b/src/lib/components/lemmy/comment/CommentVote.svelte @@ -1,15 +1,16 @@ @@ -53,7 +54,7 @@ {item.post.removed ? 'Restore' : 'Remove'} {/if} - {#if $user && $user.local_user_view.person.id != item.creator.id} + {#if $profile.user && $profile.user?.local_user_view.person.id != item.creator.id} User diff --git a/src/lib/components/lemmy/moderation/ModerationMenu.svelte b/src/lib/components/lemmy/moderation/ModerationMenu.svelte index ff7c0746..461ea8ad 100644 --- a/src/lib/components/lemmy/moderation/ModerationMenu.svelte +++ b/src/lib/components/lemmy/moderation/ModerationMenu.svelte @@ -1,11 +1,6 @@ @@ -50,8 +50,8 @@ Settings
- {#if $user} - {#each $user.follows + {#if $profile?.user} + {#each $profile.user.follows .map((f) => f.community) .sort((a, b) => a.title.localeCompare(b.title)) as follow} {/each} - {#if $user.follows.length == 0} + {#if $profile.user.follows.length == 0} -
- - - {/if} Default sort The default sort to use for feeds. diff --git a/src/routes/u/[name]/+page.svelte b/src/routes/u/[name]/+page.svelte index b36b2a27..2dcf854a 100644 --- a/src/routes/u/[name]/+page.svelte +++ b/src/routes/u/[name]/+page.svelte @@ -19,34 +19,37 @@ import { page } from '$app/stores' import { goto } from '$app/navigation' import { isComment } from '$lib/lemmy/item.js' - import { authData, getClient, user } from '$lib/lemmy.js' + import { getClient } from '$lib/lemmy.js' import { isBlocked } from '$lib/lemmy/user.js' import MultiSelect from '$lib/components/input/MultiSelect.svelte' import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js' import Modal from '$lib/components/ui/modal/Modal.svelte' import UserLink from '$lib/components/lemmy/user/UserLink.svelte' import TextArea from '$lib/components/input/TextArea.svelte' + import { profile } from '$lib/auth.js' export let data let blocking = false async function blockUser(block: number) { - if (!$user || !$authData) throw new Error('Unauthenticated') + if (!$profile?.user || !$profile?.jwt) throw new Error('Unauthenticated') blocking = true try { - const blocked = isBlocked($user, block) + const blocked = isBlocked($profile.user, block) await getClient().blockPerson({ - auth: $authData.token, + auth: $profile.jwt, block: !blocked, person_id: block, }) if (blocked) { - const index = $user.person_blocks.map((p) => p.target.id).indexOf(block) - $user.person_blocks.splice(index, 1) + const index = $profile.user.person_blocks + .map((p) => p.target.id) + .indexOf(block) + $profile.user.person_blocks.splice(index, 1) } toast({ @@ -71,13 +74,13 @@ let message = '' async function sendMessage() { - if (!$authData || message == '') return + if (!$profile?.jwt || message == '') return loadingMessage = true try { await getClient().createPrivateMessage({ - auth: $authData.token, + auth: $profile.jwt, content: message, recipient_id: data.person_view.person.id, }) @@ -103,7 +106,7 @@ {data.person_view.person.name} -{#if $authData} +{#if $profile?.user}

Message

@@ -198,7 +201,7 @@ - {#if $user && $authData && data.person_view.person.id != $user.local_user_view.person.id} + {#if $profile?.user && $profile.jwt && data.person_view.person.id != $profile.user.local_user_view.person.id}
{/if} diff --git a/src/routes/u/[name]/+page.ts b/src/routes/u/[name]/+page.ts index 85704201..5f897904 100644 --- a/src/routes/u/[name]/+page.ts +++ b/src/routes/u/[name]/+page.ts @@ -1,4 +1,5 @@ -import { authData, getClient } from '$lib/lemmy.js' +import { profile } from '$lib/auth.js' +import { getClient } from '$lib/lemmy.js' import { getItemPublished } from '$lib/lemmy/item.js' import type { SortType } from 'lemmy-js-client' import { get } from 'svelte/store' @@ -14,7 +15,7 @@ export async function load({ params, url }) { page: page, username: params.name, sort: sort, - auth: get(authData)?.token, + auth: get(profile)?.jwt, }) const items = [...user.posts, ...user.comments] From 6bb47c2b1d658c182d4e2d528eeff0430cc9fb6c Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Tue, 1 Aug 2023 13:27:24 -0700 Subject: [PATCH 05/10] feat: add guest instance --- src/lib/auth.ts | 15 ++- .../moderation/CommentModerationMenu.svelte | 2 +- src/routes/accounts/+page.svelte | 104 ++++++++++++++++++ 3 files changed, 114 insertions(+), 7 deletions(-) diff --git a/src/lib/auth.ts b/src/lib/auth.ts index 8962f2c8..0ec0fc67 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -1,13 +1,8 @@ -import { env } from '$env/dynamic/public' import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js' -import { getClient, instance } from '$lib/lemmy.js' -import { userSettings } from '$lib/settings.js' +import { DEFAULT_INSTANCE_URL, getClient, instance } from '$lib/lemmy.js' import type { MyUserInfo } from 'lemmy-js-client' import { get, writable } from 'svelte/store' -const LINKED_INSTANCE_URL = env.PUBLIC_INSTANCE_URL -const DEFAULT_INSTANCE_URL = env.PUBLIC_INSTANCE_URL || 'lemmy.ml' - function getFromStorage(key: string): T | undefined { if (typeof localStorage == 'undefined') return undefined const lc = localStorage.getItem(key) @@ -35,6 +30,7 @@ interface Profile { interface ProfileData { profiles: Profile[] profile: number + defaultInstance?: string } interface PersonData extends MyUserInfo { @@ -48,11 +44,18 @@ export const profileData = writable( profileData.subscribe((pd) => { setFromStorage('profileData', pd) + + if (pd.profile == -1) { + instance.set(get(profileData).defaultInstance ?? DEFAULT_INSTANCE_URL) + } }) export const profile = writable(getProfile()) profile.subscribe(async (p) => { + if (p?.id == -1) { + instance.set(get(profileData).defaultInstance ?? DEFAULT_INSTANCE_URL) + } if (!p || !p.jwt) { profileData.update((pd) => ({ ...pd, profile: -1 })) return diff --git a/src/lib/components/lemmy/moderation/CommentModerationMenu.svelte b/src/lib/components/lemmy/moderation/CommentModerationMenu.svelte index 53002003..f2d6ddc1 100644 --- a/src/lib/components/lemmy/moderation/CommentModerationMenu.svelte +++ b/src/lib/components/lemmy/moderation/CommentModerationMenu.svelte @@ -54,7 +54,7 @@ {item.post.removed ? 'Restore' : 'Remove'} {/if} - {#if $profile.user && $profile.user?.local_user_view.person.id != item.creator.id} + {#if $profile?.user && $profile.user?.local_user_view.person.id != item.creator.id} User diff --git a/src/routes/accounts/+page.svelte b/src/routes/accounts/+page.svelte index 85ebf03f..a124546e 100644 --- a/src/routes/accounts/+page.svelte +++ b/src/routes/accounts/+page.svelte @@ -7,11 +7,21 @@ deleteProfile, } from '$lib/auth.js' import Button from '$lib/components/input/Button.svelte' + import TextInput from '$lib/components/input/TextInput.svelte' import EditableList from '$lib/components/ui/list/EditableList.svelte' + import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js' + import { instance, validateInstance } from '$lib/lemmy.js' import { ArrowLeftOnRectangle, Icon, Plus, Trash } from 'svelte-hero-icons' import { flip } from 'svelte/animate' + + let newInstance: string = $instance + let loading = false + + Accounts + + {#if $profileData.profiles.length == 0}
Log in +
+ { + loading = true + try { + const valid = await validateInstance(newInstance.trim()) + + if (!valid) { + throw new Error('invalid instance') + } + + toast({ + content: 'Changed guest instance.', + type: ToastType.success, + }) + } catch (err) { + toast({ + content: 'Failed to contact that instance URL. Is it down?', + type: ToastType.error, + }) + + loading = false + + return + } + + $profileData.defaultInstance = newInstance + if ($currentProfile && $currentProfile.id == -1) { + $instance = newInstance + } + loading = false + }} + placeholder="Instance URL" + bind:value={newInstance} + /> + +
{:else} @@ -79,6 +135,54 @@ {/each} +
+ + Guest +
+ { + loading = true + try { + const valid = await validateInstance(newInstance.trim()) + + if (!valid) { + throw new Error('invalid instance') + } + + toast({ + content: 'Changed guest instance.', + type: ToastType.success, + }) + } catch (err) { + toast({ + content: 'Failed to contact that instance URL. Is it down?', + type: ToastType.error, + }) + } + + $profileData.defaultInstance = newInstance + if ($currentProfile && $currentProfile.id == -1) { + $instance = newInstance + } + loading = false + }} + placeholder="Instance URL" + bind:value={newInstance} + /> + +
+
+
+ + +
+ {#if $profileData.profiles.length >= 1} +
+ {#each $profileData.profiles as prof, index} + + {/each} + {/if}
{#if $profile?.user} {#each $profile.user.follows @@ -84,7 +119,7 @@ {:else} {/each} {/if} From dea23cbedbd144df6816064228cccc0db9c30f4a Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Tue, 1 Aug 2023 14:00:43 -0700 Subject: [PATCH 09/10] misc: change font --- src/lib/components/ui/Sidebar.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/ui/Sidebar.svelte b/src/lib/components/ui/Sidebar.svelte index ecd28a52..58a8bef9 100644 --- a/src/lib/components/ui/Sidebar.svelte +++ b/src/lib/components/ui/Sidebar.svelte @@ -82,7 +82,7 @@ /> {prof.username} - + @{prof.instance} From 6ff2d2fc90c8b0426aa9dfc14b54d18f0a5a3cf5 Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Tue, 1 Aug 2023 14:02:23 -0700 Subject: [PATCH 10/10] design: switch to col --- src/lib/components/ui/Sidebar.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/components/ui/Sidebar.svelte b/src/lib/components/ui/Sidebar.svelte index 58a8bef9..e793601e 100644 --- a/src/lib/components/ui/Sidebar.svelte +++ b/src/lib/components/ui/Sidebar.svelte @@ -80,10 +80,10 @@ class="text-blue-500" style="filter: hue-rotate({index * 50}deg)" /> - + {prof.username} - - @{prof.instance} + + {prof.instance}