feat: hide replies from untrusted users
This commit is contained in:
@@ -6,6 +6,7 @@ import SecondaryPageLayout from '@/layouts/SecondaryPageLayout'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { useAutoplay } from '@/providers/AutoplayProvider'
|
||||
import { useTheme } from '@/providers/ThemeProvider'
|
||||
import { useUserTrust } from '@/providers/UserTrustProvider'
|
||||
import { SelectValue } from '@radix-ui/react-select'
|
||||
import { forwardRef, HTMLProps, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
@@ -15,6 +16,8 @@ const GeneralSettingsPage = forwardRef(({ index }: { index?: number }, ref) => {
|
||||
const [language, setLanguage] = useState<TLanguage>(i18n.language as TLanguage)
|
||||
const { themeSetting, setThemeSetting } = useTheme()
|
||||
const { autoplay, setAutoplay } = useAutoplay()
|
||||
const { enabled: hideUntrustedRepliesEnabled, updateEnabled: updateHideUntrustedRepliesEnabled } =
|
||||
useUserTrust()
|
||||
|
||||
const handleLanguageChange = (value: TLanguage) => {
|
||||
i18n.changeLanguage(value)
|
||||
@@ -63,6 +66,19 @@ const GeneralSettingsPage = forwardRef(({ index }: { index?: number }, ref) => {
|
||||
</Label>
|
||||
<Switch id="autoplay" checked={autoplay} onCheckedChange={setAutoplay} />
|
||||
</SettingItem>
|
||||
<SettingItem>
|
||||
<Label htmlFor="hide-untrusted-replies" className="text-base font-normal">
|
||||
{t('Hide replies from untrusted users')}
|
||||
<div className="text-muted-foreground">
|
||||
{t('Only show replies from your followed users and the users they follow')}
|
||||
</div>
|
||||
</Label>
|
||||
<Switch
|
||||
id="hide-untrusted-replies"
|
||||
checked={hideUntrustedRepliesEnabled}
|
||||
onCheckedChange={updateHideUntrustedRepliesEnabled}
|
||||
/>
|
||||
</SettingItem>
|
||||
</div>
|
||||
</SecondaryPageLayout>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user