fix: remove hide button on piefed
This commit is contained in:
4 files changed
+34
-22
No files matched your search
@@ -4,7 +4,6 @@
|
|||||||
"semi": false,
|
"semi": false,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"htmlWhitespaceSensitivity": "ignore",
|
"htmlWhitespaceSensitivity": "ignore",
|
||||||
|
|
||||||
"plugins": ["prettier-plugin-svelte"],
|
"plugins": ["prettier-plugin-svelte"],
|
||||||
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
import { searchParam } from '$lib/util.svelte'
|
import { searchParam } from '$lib/util.svelte'
|
||||||
import { Select } from 'mono-svelte'
|
import { Select } from 'mono-svelte'
|
||||||
import {
|
import {
|
||||||
|
ChartBar,
|
||||||
GlobeAmericas,
|
GlobeAmericas,
|
||||||
Icon,
|
Icon,
|
||||||
MapPin,
|
MapPin,
|
||||||
@@ -14,6 +15,8 @@
|
|||||||
import { t } from '$lib/i18n/translations'
|
import { t } from '$lib/i18n/translations'
|
||||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
import Option from 'mono-svelte/forms/select/Option.svelte'
|
||||||
import type { SelectProps } from 'mono-svelte/forms/select/Select.svelte'
|
import type { SelectProps } from 'mono-svelte/forms/select/Select.svelte'
|
||||||
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
|
import { PiefedClient } from '$lib/client/piefed/piefed'
|
||||||
|
|
||||||
interface Props extends SelectProps<string> {
|
interface Props extends SelectProps<string> {
|
||||||
selected: string
|
selected: string
|
||||||
@@ -49,6 +52,11 @@
|
|||||||
<Option value="All" icon={GlobeAmericas}>
|
<Option value="All" icon={GlobeAmericas}>
|
||||||
{$t('filter.location.all')}
|
{$t('filter.location.all')}
|
||||||
</Option>
|
</Option>
|
||||||
|
{#if client() instanceof PiefedClient}
|
||||||
|
<Option value="Popular" icon={ChartBar}>
|
||||||
|
{$t('filter.location.popular')}
|
||||||
|
</Option>
|
||||||
|
{/if}
|
||||||
<Option value="Local" icon={MapPin}>{$t('filter.location.local')}</Option>
|
<Option value="Local" icon={MapPin}>{$t('filter.location.local')}</Option>
|
||||||
<Option
|
<Option
|
||||||
value="Subscribed"
|
value="Subscribed"
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
} from 'svelte-hero-icons'
|
} from 'svelte-hero-icons'
|
||||||
import { report } from '../../moderation/moderation'
|
import { report } from '../../moderation/moderation'
|
||||||
import { hidePost } from '../helpers'
|
import { hidePost } from '../helpers'
|
||||||
|
import { client } from '$lib/client/lemmy.svelte'
|
||||||
|
import { PiefedClient } from '$lib/client/piefed/piefed'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
post: PostView
|
post: PostView
|
||||||
@@ -162,26 +164,28 @@
|
|||||||
</MenuButton>
|
</MenuButton>
|
||||||
{/if}
|
{/if}
|
||||||
{#if profile.current.user?.local_user_view.person.id != post.creator.id}
|
{#if profile.current.user?.local_user_view.person.id != post.creator.id}
|
||||||
<MenuButton
|
{#if !(client() instanceof PiefedClient)}
|
||||||
onclick={async () => {
|
<MenuButton
|
||||||
if (!profile.current?.jwt) return
|
onclick={async () => {
|
||||||
const hidden = await hidePost(
|
if (!profile.current?.jwt) return
|
||||||
post.post.id,
|
const hidden = await hidePost(
|
||||||
!post.hidden,
|
post.post.id,
|
||||||
profile.current?.jwt,
|
!post.hidden,
|
||||||
)
|
profile.current?.jwt,
|
||||||
post.hidden = hidden
|
)
|
||||||
if (hidden) onhide?.(hidden)
|
post.hidden = hidden
|
||||||
}}
|
if (hidden) onhide?.(hidden)
|
||||||
color="danger-subtle"
|
}}
|
||||||
>
|
color="danger-subtle"
|
||||||
{#snippet prefix()}
|
>
|
||||||
<Icon src={XMark} size="16" micro />
|
{#snippet prefix()}
|
||||||
{/snippet}
|
<Icon src={XMark} size="16" micro />
|
||||||
{post.hidden
|
{/snippet}
|
||||||
? $t('post.actions.more.unhide')
|
{post.hidden
|
||||||
: $t('post.actions.more.hide')}
|
? $t('post.actions.more.unhide')
|
||||||
</MenuButton>
|
: $t('post.actions.more.hide')}
|
||||||
|
</MenuButton>
|
||||||
|
{/if}
|
||||||
<MenuButton onclick={() => report(post)} color="danger-subtle">
|
<MenuButton onclick={() => report(post)} color="danger-subtle">
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={Flag} size="16" micro />
|
<Icon src={Flag} size="16" micro />
|
||||||
|
|||||||
@@ -71,7 +71,8 @@
|
|||||||
"local": "Local",
|
"local": "Local",
|
||||||
"subscribed": "Subscriptions",
|
"subscribed": "Subscriptions",
|
||||||
"moderator": "Moderator",
|
"moderator": "Moderator",
|
||||||
"global": "Global"
|
"global": "Global",
|
||||||
|
"popular": "Popular"
|
||||||
},
|
},
|
||||||
"sort": {
|
"sort": {
|
||||||
"label": "Sort",
|
"label": "Sort",
|
||||||
|
|||||||
Reference in new issue
Block a user