feat: add profile page filtering
This commit is contained in:
1 parent
575662ae2c
commit
53ef843cde
2 files changed
+30
-11
No files matched your search
@@ -0,0 +1,6 @@
|
|||||||
|
import type { MyUserInfo } from 'lemmy-js-client'
|
||||||
|
|
||||||
|
export const isMod = (me: MyUserInfo, community: number) =>
|
||||||
|
me.moderates.map((c) => c.community.id).includes(community)
|
||||||
|
|
||||||
|
export const isAdmin = (me: MyUserInfo) => me.local_user_view.person.admin
|
||||||
@@ -77,17 +77,30 @@
|
|||||||
|
|
||||||
<div class="flex flex-col-reverse lg:flex-row gap-4 max-w-full w-full">
|
<div class="flex flex-col-reverse lg:flex-row gap-4 max-w-full w-full">
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full">
|
<div class="flex flex-col gap-4 max-w-full w-full">
|
||||||
<MultiSelect
|
<div class="flex flex-row gap-4 flex-wrap">
|
||||||
options={['New', 'TopAll']}
|
<MultiSelect
|
||||||
optionNames={['New', 'Top']}
|
options={['New', 'TopAll']}
|
||||||
selected={data.sort}
|
optionNames={['New', 'Top']}
|
||||||
on:select={(e) => {
|
selected={data.sort}
|
||||||
$page.url.searchParams.set('sort', e.detail)
|
on:select={(e) => {
|
||||||
goto($page.url.toString(), {
|
$page.url.searchParams.set('sort', e.detail)
|
||||||
invalidateAll: true,
|
goto($page.url.toString(), {
|
||||||
})
|
invalidateAll: true,
|
||||||
}}
|
})
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
<MultiSelect
|
||||||
|
options={['all', 'posts', 'comments']}
|
||||||
|
optionNames={['All', 'Posts', 'Comments']}
|
||||||
|
selected={data.type}
|
||||||
|
on:select={(e) => {
|
||||||
|
$page.url.searchParams.set('type', e.detail)
|
||||||
|
goto($page.url.toString(), {
|
||||||
|
invalidateAll: true,
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
{#each data.items as item (item.counts.id)}
|
{#each data.items as item (item.counts.id)}
|
||||||
{#if isComment(item) && (data.type == 'all' || data.type == 'comments')}
|
{#if isComment(item) && (data.type == 'all' || data.type == 'comments')}
|
||||||
<CommentItem comment={item} />
|
<CommentItem comment={item} />
|
||||||
|
|||||||
Reference in new issue
Block a user