fix up debugmod
This commit is contained in:
@@ -688,11 +688,6 @@
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"src/view/screens/DebugMod.tsx": {
|
||||
"@typescript-eslint/no-explicit-any": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"src/view/shell/createNativeStackNavigatorWithAuth.tsx": {
|
||||
"@typescript-eslint/no-explicit-any": {
|
||||
"count": 1
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {useMemo, useState} from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {useSharedValue} from 'react-native-reanimated'
|
||||
import {
|
||||
type AppBskyActorDefs,
|
||||
type AppBskyFeedDefs,
|
||||
@@ -54,6 +55,7 @@ import * as ProfileCard from '#/components/ProfileCard'
|
||||
import {H1, H3, P, Text} from '#/components/Typography'
|
||||
import {ScreenHider} from '../../components/moderation/ScreenHider'
|
||||
import {NotificationFeedItem} from '../com/notifications/NotificationFeedItem'
|
||||
import {PagerHeaderProvider} from '../com/pager/PagerHeaderContext'
|
||||
import {PostFeedItem} from '../com/posts/PostFeedItem'
|
||||
|
||||
const LABEL_VALUES: (keyof typeof LABELS)[] = Object.keys(
|
||||
@@ -272,8 +274,11 @@ export const DebugModScreen = ({}: NativeStackScreenProps<
|
||||
return moderatePost(post, modOpts)
|
||||
}, [post, modOpts])
|
||||
|
||||
const sv = useSharedValue(0)
|
||||
|
||||
return (
|
||||
<Layout.Screen>
|
||||
<PagerHeaderProvider headerHeight={0} scrollY={sv}>
|
||||
<moderationOptsOverrideContext.Provider value={modOpts}>
|
||||
<ScrollView>
|
||||
<CenteredView style={[t.atoms.bg, a.px_lg, a.py_lg]}>
|
||||
@@ -374,9 +379,13 @@ export const DebugModScreen = ({}: NativeStackScreenProps<
|
||||
<Toggle.Checkbox />
|
||||
<Toggle.LabelText>Target is me</Toggle.LabelText>
|
||||
</Toggle.Item>
|
||||
<Toggle.Item name="following" label="Following target">
|
||||
<Toggle.Item
|
||||
name="following"
|
||||
label="Following target">
|
||||
<Toggle.Checkbox />
|
||||
<Toggle.LabelText>Following target</Toggle.LabelText>
|
||||
<Toggle.LabelText>
|
||||
Following target
|
||||
</Toggle.LabelText>
|
||||
</Toggle.Item>
|
||||
<Toggle.Item name="selfLabel" label="Self label">
|
||||
<Toggle.Checkbox />
|
||||
@@ -499,7 +508,9 @@ export const DebugModScreen = ({}: NativeStackScreenProps<
|
||||
<ToggleButton.ButtonText>Post</ToggleButton.ButtonText>
|
||||
</ToggleButton.Button>
|
||||
<ToggleButton.Button name="notifications" label="Notifications">
|
||||
<ToggleButton.ButtonText>Notifications</ToggleButton.ButtonText>
|
||||
<ToggleButton.ButtonText>
|
||||
Notifications
|
||||
</ToggleButton.ButtonText>
|
||||
</ToggleButton.Button>
|
||||
<ToggleButton.Button name="account" label="Account">
|
||||
<ToggleButton.ButtonText>Account</ToggleButton.ButtonText>
|
||||
@@ -537,10 +548,16 @@ export const DebugModScreen = ({}: NativeStackScreenProps<
|
||||
{view[0] === 'notifications' && (
|
||||
<>
|
||||
<Heading title="Notification" subtitle="quote or reply" />
|
||||
<MockNotifItem notif={replyNotif} moderationOpts={modOpts} />
|
||||
<MockNotifItem
|
||||
notif={replyNotif}
|
||||
moderationOpts={modOpts}
|
||||
/>
|
||||
<View style={{height: 20}} />
|
||||
<Heading title="Notification" subtitle="follow or like" />
|
||||
<MockNotifItem notif={followNotif} moderationOpts={modOpts} />
|
||||
<MockNotifItem
|
||||
notif={followNotif}
|
||||
moderationOpts={modOpts}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -591,6 +608,7 @@ export const DebugModScreen = ({}: NativeStackScreenProps<
|
||||
</CenteredView>
|
||||
</ScrollView>
|
||||
</moderationOptsOverrideContext.Provider>
|
||||
</PagerHeaderProvider>
|
||||
</Layout.Screen>
|
||||
)
|
||||
}
|
||||
@@ -760,7 +778,7 @@ function SmallToggler({
|
||||
)
|
||||
}
|
||||
|
||||
function DataView({label, data}: {label: string; data: any}) {
|
||||
function DataView({label, data}: {label: string; data: unknown}) {
|
||||
return (
|
||||
<Toggler label={label}>
|
||||
<Text style={[{fontFamily: 'monospace'}, a.p_md]}>
|
||||
|
||||
Reference in New Issue
Block a user