design: make pageination more consistent with other floats

This commit is contained in:
James Xylight committed 2025-09-05 16:42:09 -07:00
1 parent 57d2bf5e72
commit 63eafdd1e1
6 files changed
+25 -14

No files matched your search

@@ -314,10 +314,11 @@
<div class="flex flex-col gap-1"> <div class="flex flex-col gap-1">
<span class="font-medium text-sm">{$t('form.post.community')}</span> <span class="font-medium text-sm">{$t('form.post.community')}</span>
<Button <Button
class="w-full bg-white! dark:bg-black! h-[38px]" class="w-full"
onclick={() => (data.community = null)} onclick={() => (data.community = null)}
alignment="left" alignment="left"
size="sm" size="sm"
rounding="xl"
> >
{#snippet prefix()} {#snippet prefix()}
<Avatar <Avatar
@@ -327,7 +328,7 @@
/> />
{/snippet} {/snippet}
<div class="flex flex-col gap-0"> <div class="flex flex-col gap-0">
<span class="text-xs">{data.community.name}</span> <span class="text-sm">{data.community.name}</span>
<span class="text-[10px] leading-3"> <span class="text-[10px] leading-3">
{new URL(data.community.actor_id).hostname} {new URL(data.community.actor_id).hostname}
</span> </span>
+10 -4
View File
@@ -42,10 +42,15 @@
} }
</script> </script>
<nav {#if hasMore || page != 1}
<nav
aria-label={$t('aria.pagination.nav')} aria-label={$t('aria.pagination.nav')}
class="flex flex-row gap-2 items-center justify-center backdrop-blur-xl border border-slate-200 dark:border-zinc-800 rounded-full overflow-hidden w-max mx-auto p-0.5" class={[
> 'flex flex-row gap-2 items-center justify-center bg-white dark:bg-zinc-900',
'border border-slate-200 dark:border-zinc-800 rounded-full overflow-hidden w-max mx-auto p-0.5',
'shadow-md',
]}
>
{#if children} {#if children}
<span class="text-sm text-slate-600 dark:text-zinc-400 font-medium"> <span class="text-sm text-slate-600 dark:text-zinc-400 font-medium">
{@render children?.()} {@render children?.()}
@@ -99,4 +104,5 @@
<Icon src={ChevronRight} size="24" mini /> <Icon src={ChevronRight} size="24" mini />
{/snippet} {/snippet}
</Button> </Button>
</nav> </nav>
{/if}
@@ -13,6 +13,7 @@
buildUrl?: (currentRoute: SvelteURL | undefined, href: string) => string buildUrl?: (currentRoute: SvelteURL | undefined, href: string) => string
children?: import('svelte').Snippet children?: import('svelte').Snippet
style?: 'header' | 'subpage' style?: 'header' | 'subpage'
margin?: boolean
} }
let { let {
@@ -21,6 +22,7 @@
buildUrl = (_, href) => href, buildUrl = (_, href) => href,
children, children,
style = 'header', style = 'header',
margin = true,
}: Props = $props() }: Props = $props()
let matchType = $derived<('search' | 'pathname')[]>( let matchType = $derived<('search' | 'pathname')[]>(
@@ -53,10 +55,12 @@
<nav <nav
class={[ class={[
'flex flex-row items-center my-2 sm:mt-0 flex-wrap z-20', 'flex flex-row items-center sm:mt-0 flex-wrap z-20',
style == 'header' style == 'header'
? 'p-1 gap-x-8 gap-y-4 justify-center sm:justify-start' ? 'p-1 gap-x-8 gap-y-4 justify-center sm:justify-start'
: 'gap-2', : 'gap-2',
margin && 'my-2',
margin && style == 'subpage' && 'mb-3',
]} ]}
> >
{#each routes as route, index (route.href)} {#each routes as route, index (route.href)}
@@ -86,7 +90,3 @@
{/each} {/each}
{@render children?.()} {@render children?.()}
</nav> </nav>
{#if style == 'subpage'}
<div class="h-3"></div>
{/if}
+3 -2
View File
@@ -17,6 +17,7 @@
import { expoOut } from 'svelte/easing' import { expoOut } from 'svelte/easing'
import { fly } from 'svelte/transition' import { fly } from 'svelte/transition'
import SearchBar from '../search/SearchBar.svelte' import SearchBar from '../search/SearchBar.svelte'
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
let { data } = $props() let { data } = $props()
@@ -157,10 +158,10 @@
</ul> </ul>
{/if} {/if}
{#if data.communities.value.length > 0} {#if data.communities.value.length > 0}
<div class="sticky z-30 mx-auto max-w-full bottom-22 lg:bottom-6"> <Fixate placement="bottom">
<Pageination <Pageination
page={Number(page.url.searchParams.get('page')) || 1} page={Number(page.url.searchParams.get('page')) || 1}
href={c => `?page=${c}`} href={c => `?page=${c}`}
/> />
</div> </Fixate>
{/if} {/if}
@@ -35,9 +35,11 @@
<Header pageHeader> <Header pageHeader>
{routes.find(r => page.url.pathname == r.href)?.name ?? {routes.find(r => page.url.pathname == r.href)?.name ??
$t('routes.profile.credentials')} $t('routes.profile.credentials')}
{#snippet extended()}
<Tabs style="subpage" margin={false} {routes}></Tabs>
{/snippet}
</Header> </Header>
<Tabs style="subpage" {routes}></Tabs>
<div <div
class={[ class={[
page.url.pathname == '/profile/password' && ' p-8', page.url.pathname == '/profile/password' && ' p-8',
+1
View File
@@ -67,6 +67,7 @@
icon={Bookmark} icon={Bookmark}
title="No saved items" title="No saved items"
description="Save posts or comments, and they'll be here to refer to them later." description="Save posts or comments, and they'll be here to refer to them later."
class="my-auto"
/> />
{:else} {:else}
<CommonList items={data.data} size="lg"> <CommonList items={data.data} size="lg">