diff --git a/src/lib/client/lemmy.svelte.ts b/src/lib/client/lemmy.svelte.ts index becd75f3..299d3e64 100644 --- a/src/lib/client/lemmy.svelte.ts +++ b/src/lib/client/lemmy.svelte.ts @@ -72,8 +72,12 @@ export function client({ clientType = profile.current.client ?? DEFAULT_CLIENT_TYPE } + // we use nullish coealsiaihsa something so that + // we can set auth = '' to remove it + const jwt = auth ?? profile.current?.jwt + // but not here, so that if jwt == '', it doesnt put a bearer const headers = jwt ? { authorization: `Bearer ${jwt}` } : {} return new (clientType.name == 'piefed' ? PiefedClient : LemmyClient)( @@ -85,6 +89,7 @@ export function client({ ) } +// here for parts where i forgor to switch export function getClient( instanceURL?: string, func?: ( diff --git a/src/lib/components/lemmy/community/CommunityItem.svelte b/src/lib/components/lemmy/community/CommunityItem.svelte index 4fb34161..c06a5a7c 100644 --- a/src/lib/components/lemmy/community/CommunityItem.svelte +++ b/src/lib/components/lemmy/community/CommunityItem.svelte @@ -54,7 +54,7 @@
@@ -63,7 +63,7 @@ community.community.name, community.community.actor_id, )}" - class="flex-1 w-full overflow-hidden" + class="flex-1 w-full overflow-hidden group" data-sveltekit-preload-data="tap" >
@@ -88,7 +88,9 @@
- {community.community.title} +

+ {community.community.title} +

{#if community.community.deleted} {/if}
-
+
{new URL(community.community.actor_id).hostname} diff --git a/src/lib/components/lemmy/post/Post.svelte b/src/lib/components/lemmy/post/Post.svelte index 0c228734..2c5a5f90 100644 --- a/src/lib/components/lemmy/post/Post.svelte +++ b/src/lib/components/lemmy/post/Post.svelte @@ -78,7 +78,7 @@ -->
{$t('form.post.community')} + {/if} + + {#if page} +
+ {#key page} +
+ {page} +
+ {/key} +
+ {/if} + - {/if} - - {#if page} -
- {#key page} -
- {page} -
- {/key} -
- {/if} - - - + +{/if} diff --git a/src/lib/components/ui/generic/Fixate.svelte b/src/lib/components/ui/generic/Fixate.svelte index c01e19e7..7892cc0c 100644 --- a/src/lib/components/ui/generic/Fixate.svelte +++ b/src/lib/components/ui/generic/Fixate.svelte @@ -3,7 +3,7 @@ const placements = { top: 'top-6 lg:top-22', - bottom: 'bottom-22 lg:bottom-6', + bottom: 'bottom-22 lg:bottom-6 mt-6', } interface Props { diff --git a/src/lib/components/ui/layout/pages/Tabs.svelte b/src/lib/components/ui/layout/pages/Tabs.svelte index b223e9f6..c5987db7 100644 --- a/src/lib/components/ui/layout/pages/Tabs.svelte +++ b/src/lib/components/ui/layout/pages/Tabs.svelte @@ -13,6 +13,7 @@ buildUrl?: (currentRoute: SvelteURL | undefined, href: string) => string children?: import('svelte').Snippet style?: 'header' | 'subpage' + margin?: boolean } let { @@ -21,6 +22,7 @@ buildUrl = (_, href) => href, children, style = 'header', + margin = true, }: Props = $props() let matchType = $derived<('search' | 'pathname')[]>( @@ -53,10 +55,12 @@ - -{#if style == 'subpage'} -
-{/if} diff --git a/src/lib/mono/index.ts b/src/lib/mono/index.ts index dd28f09c..11b0bde3 100644 --- a/src/lib/mono/index.ts +++ b/src/lib/mono/index.ts @@ -3,6 +3,7 @@ export { default as Button } from './button/Button.svelte' export { buttonColor, buttonSize, buttonShadow } from './button/Button.svelte' export { default as Spinner } from './loader/Spinner.svelte' +export { default as TextLoader } from './loader/TextLoader.svelte' export { default as Material } from './materials/Material.svelte' export { default as Label } from './forms/Label.svelte' diff --git a/src/lib/mono/loader/TextLoader.svelte b/src/lib/mono/loader/TextLoader.svelte new file mode 100644 index 00000000..4f463803 --- /dev/null +++ b/src/lib/mono/loader/TextLoader.svelte @@ -0,0 +1,42 @@ + + +
+ {@render children?.()} +
+ + diff --git a/src/lib/mono/toast/Toast.svelte b/src/lib/mono/toast/Toast.svelte index b4d3fbd2..ae76598f 100644 --- a/src/lib/mono/toast/Toast.svelte +++ b/src/lib/mono/toast/Toast.svelte @@ -24,8 +24,8 @@
4 - ? comment.comment_view.comment.id - : split.slice(-5).join('.') + const threadPath = split.slice(-5).join('.') redirect( 302, diff --git a/src/routes/communities/+page.svelte b/src/routes/communities/+page.svelte index c06ee075..3fc22943 100644 --- a/src/routes/communities/+page.svelte +++ b/src/routes/communities/+page.svelte @@ -17,6 +17,7 @@ import { expoOut } from 'svelte/easing' import { fly } from 'svelte/transition' import SearchBar from '../search/SearchBar.svelte' + import Fixate from '$lib/components/ui/generic/Fixate.svelte' let { data } = $props() @@ -157,10 +158,10 @@ {/if} {#if data.communities.value.length > 0} -
+ `?page=${c}`} /> -
+ {/if} diff --git a/src/routes/create/+layout.svelte b/src/routes/create/+layout.svelte index aff9ef0e..2c1686a1 100644 --- a/src/routes/create/+layout.svelte +++ b/src/routes/create/+layout.svelte @@ -1,4 +1,5 @@ -
+
- diff --git a/src/routes/signup/[instance]/+page.svelte b/src/routes/signup/[instance]/+page.svelte index b64436af..cdb68435 100644 --- a/src/routes/signup/[instance]/+page.svelte +++ b/src/routes/signup/[instance]/+page.svelte @@ -157,8 +157,7 @@ class="flex flex-col gap-4 h-full w-full flex-2/3" onsubmit={preventDefault(submit)} > - - @@ -177,6 +176,7 @@ {/snippet} + {#if data.site_view.local_site.registration_mode != 'Closed'}
diff --git a/src/routes/u/[name]/+page.ts b/src/routes/u/[name]/+page.ts index 02fdc519..138b9639 100644 --- a/src/routes/u/[name]/+page.ts +++ b/src/routes/u/[name]/+page.ts @@ -1,4 +1,4 @@ -import { getClient } from '$lib/client/lemmy.svelte' +import { client } from '$lib/client/lemmy.svelte' import { getItemPublished } from '$lib/lemmy/item.js' import { ReactiveState } from '$lib/promise.svelte.js' import type { SortType } from '$lib/client/types' @@ -9,7 +9,7 @@ export async function load({ params, url, fetch }) { (url.searchParams.get('type') as 'comments' | 'posts' | 'all') || 'all' const sort: SortType = (url.searchParams.get('sort') as SortType) || 'New' - const user = await getClient(undefined, fetch).getPersonDetails({ + const user = await client({ func: fetch }).getPersonDetails({ limit: 20, page: page, username: params.name, diff --git a/src/style/app.css b/src/style/app.css index 5b210d37..626ba25e 100644 --- a/src/style/app.css +++ b/src/style/app.css @@ -11,7 +11,7 @@ --font-display: Inter, system-ui, sans-serif; --font-mono: monospace; - --animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1); + --animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1) forwards; --ease-cubic: cubic-bezier(0.075, 0.82, 0.165, 1); --spacing-22: 88px;