impr: use Fixate component
This commit is contained in:
23 files changed
+66
-63
No files matched your search
@@ -74,7 +74,7 @@
|
||||
{/if}
|
||||
</ul>
|
||||
<form
|
||||
class="flex flex-row items-center gap-2 mt-auto w-full"
|
||||
class="flex flex-row gap-2 mt-auto w-full"
|
||||
onsubmit={preventDefault(() => {
|
||||
trycatch(async () => {
|
||||
if (!profile.current?.jwt || newAdmin == '') return
|
||||
@@ -106,7 +106,7 @@
|
||||
disabled={adding}
|
||||
rounding="xl"
|
||||
color="primary"
|
||||
class="h-full"
|
||||
size="sm"
|
||||
submit
|
||||
>
|
||||
{#snippet prefix()}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { goto } from '$app/navigation'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import PostForm from '$lib/components/lemmy/post/form/PostForm.svelte'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { getSessionStorage, setSessionStorage } from '$lib/session.js'
|
||||
import { onDestroy, onMount } from 'svelte'
|
||||
@@ -24,7 +23,7 @@
|
||||
})
|
||||
|
||||
// TODO remove this
|
||||
// eslint-disable-next-line
|
||||
|
||||
let post = getSessionStorage('postDraft') as any
|
||||
</script>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
import { Button, Option, Select } from 'mono-svelte'
|
||||
import { ArrowPath, Check, Funnel, Icon, Inbox } from 'svelte-hero-icons'
|
||||
import InboxItem from './InboxItem.svelte'
|
||||
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
|
||||
|
||||
let { data } = $props()
|
||||
|
||||
@@ -114,9 +115,7 @@
|
||||
</CommonList>
|
||||
{/if}
|
||||
{#if !(data.page == 1 && (data?.inbox?.value.length ?? 0) == 0)}
|
||||
<div
|
||||
class="sticky z-30 mx-auto max-w-full self-end mt-auto bottom-22 lg:bottom-6"
|
||||
>
|
||||
<Fixate placement="bottom">
|
||||
<Pageination
|
||||
hasMore={!(
|
||||
!data.inbox || (data.inbox.value?.length ?? 0) < (data?.limit ?? 0)
|
||||
@@ -124,5 +123,5 @@
|
||||
page={data.page}
|
||||
href={page => `?page=${page}`}
|
||||
/>
|
||||
</div>
|
||||
</Fixate>
|
||||
{/if}
|
||||
@@ -21,6 +21,4 @@
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<div class="w-full space-y-4 pb-8">
|
||||
{@render children?.()}
|
||||
</div>
|
||||
{@render children?.()}
|
||||
@@ -15,6 +15,7 @@
|
||||
import { tick } from 'svelte'
|
||||
import { Check, Funnel, Icon, ShieldCheck, XMark } from 'svelte-hero-icons'
|
||||
import Report from './Report.svelte'
|
||||
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
|
||||
|
||||
let { data = $bindable() } = $props()
|
||||
|
||||
@@ -153,11 +154,13 @@
|
||||
{/if}
|
||||
{/snippet}
|
||||
</CommonList>
|
||||
<Pageination
|
||||
page={data.page}
|
||||
href={current => `?page=${current}`}
|
||||
hasMore={data.items.value.length >= 20}
|
||||
/>
|
||||
<Fixate placement="bottom">
|
||||
<Pageination
|
||||
page={data.page}
|
||||
href={current => `?page=${current}`}
|
||||
hasMore={data.items.value.length >= 20}
|
||||
/>
|
||||
</Fixate>
|
||||
{:else}
|
||||
<div class="h-full grid place-items-center">
|
||||
<Placeholder
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||
import Entity from '$lib/components/ui/Entity.svelte'
|
||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { getClient } from '$lib/lemmy.svelte.js'
|
||||
import type {
|
||||
@@ -14,11 +15,8 @@
|
||||
PersonBlockView,
|
||||
} from 'lemmy-js-client'
|
||||
import { Button } from 'mono-svelte'
|
||||
import Material from 'mono-svelte/materials/Material.svelte'
|
||||
import { Check, Icon, XMark } from 'svelte-hero-icons'
|
||||
import type { PageData } from './$types.js'
|
||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||
|
||||
interface Props {
|
||||
// sveltekit doesn't feel like making types work right now
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { page } from '$app/state'
|
||||
import CommentItem from '$lib/components/lemmy/comment/CommentItem.svelte'
|
||||
import PostItem from '$lib/components/lemmy/post/PostItem.svelte'
|
||||
import Fixate from '$lib/components/ui/generic/Fixate.svelte'
|
||||
import CommonList from '$lib/components/ui/layout/CommonList.svelte'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||
@@ -78,10 +79,10 @@
|
||||
{/snippet}
|
||||
</CommonList>
|
||||
{/if}
|
||||
<div class="sticky z-30 mx-auto max-w-full bottom-22 lg:bottom-6">
|
||||
<Fixate placement="bottom">
|
||||
<Pageination
|
||||
hasMore={data.data.length == 40}
|
||||
href={page => `?page=${page}`}
|
||||
page={data.page}
|
||||
/>
|
||||
</div>
|
||||
</Fixate>
|
||||
@@ -26,7 +26,7 @@ export async function load({ url, fetch }) {
|
||||
const { posts, comments } = await client({ func: fetch }).getPersonDetails({
|
||||
saved_only: true,
|
||||
limit: 20,
|
||||
page: 1,
|
||||
page: page,
|
||||
person_id: user?.local_user_view.person.id,
|
||||
})
|
||||
|
||||
|
||||
@@ -13,30 +13,28 @@
|
||||
let searchElement = $state<HTMLInputElement>()
|
||||
</script>
|
||||
|
||||
<div class="mb-0 sticky z-30 top-6 lg:top-22">
|
||||
<div
|
||||
class="flex gap-2 flex-row items-center w-full text-base h-10 drop-shadow-xl"
|
||||
<div
|
||||
class="flex gap-2 flex-row items-center w-full text-base h-10 drop-shadow-xl"
|
||||
>
|
||||
<TextInput
|
||||
bind:value={query}
|
||||
bind:element={searchElement}
|
||||
name="q"
|
||||
placeholder={$t('routes.search.query')}
|
||||
size="lg"
|
||||
class="flex-1 rounded-full! h-full text-base!"
|
||||
/>
|
||||
<Button
|
||||
submit
|
||||
color="primary"
|
||||
size="custom"
|
||||
class="shrink-0 h-full aspect-square shadow-md"
|
||||
title="Search"
|
||||
rounding="pill"
|
||||
loading={navigating.to?.route.id == '/search'}
|
||||
>
|
||||
<TextInput
|
||||
bind:value={query}
|
||||
bind:element={searchElement}
|
||||
name="q"
|
||||
placeholder={$t('routes.search.query')}
|
||||
size="lg"
|
||||
class="flex-1 rounded-full! h-full text-base!"
|
||||
/>
|
||||
<Button
|
||||
submit
|
||||
color="primary"
|
||||
size="custom"
|
||||
class="shrink-0 h-full aspect-square shadow-md"
|
||||
title="Search"
|
||||
rounding="pill"
|
||||
loading={navigating.to?.route.id == '/search'}
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={MagnifyingGlass} size="16" micro />
|
||||
{/snippet}
|
||||
</Button>
|
||||
</div>
|
||||
{#snippet prefix()}
|
||||
<Icon src={MagnifyingGlass} size="16" micro />
|
||||
{/snippet}
|
||||
</Button>
|
||||
</div>
|
||||
Reference in new issue
Block a user