|
1 | | -import { Screen, Box, Text, Button, PageHeader } from '@/components'; |
2 | | -import { useRouter } from 'expo-router'; |
3 | | -import { useSignup } from '@/lib/signup/SignupContext'; |
4 | | - |
5 | | -type ModerationLevel = 1 | 2 | 3; |
6 | | - |
7 | | -const MODERATION_LABELS: Record<ModerationLevel, string> = { |
8 | | - 1: 'Strict', |
9 | | - 2: 'Moderate', |
10 | | - 3: 'Relaxed', |
11 | | -}; |
12 | | - |
13 | | -export default function SetModeration() { |
14 | | - const router = useRouter(); |
15 | | - const { data, setModeration, close, finish } = useSignup(); |
16 | | - |
17 | | - const updateCategory = ( |
18 | | - category: 'violence' | 'sexual' | 'hate', |
19 | | - level: ModerationLevel, |
20 | | - ) => { |
21 | | - setModeration({ |
22 | | - ...data.moderation, |
23 | | - [category]: level, |
24 | | - }); |
25 | | - }; |
26 | | - |
27 | | - return ( |
28 | | - <Screen background={{ gradient: 'surround' }}> |
29 | | - <Box flexDirection="column" marginHorizontal="lg" height="100%"> |
30 | | - <PageHeader onBack={() => router.back()} onClose={close} /> |
31 | | - <Box flex={1} gap="sm"> |
32 | | - <Text variant="title">Device content moderation</Text> |
33 | | - <Text variant="body" color="neutralSurface"> |
34 | | - Content moderation only filters what you see on this device if |
35 | | - you're using the default futo.org server. |
36 | | - </Text> |
37 | | - <Text variant="body" color="neutralSurface"> |
38 | | - You will still be able to create posts that violate these settings. |
39 | | - </Text> |
40 | | - <Text variant="body" color="neutralSurface"> |
41 | | - Polycentric will never block or censor content. |
42 | | - </Text> |
43 | | - <Text variant="body" color="neutralSurface"> |
44 | | - This setting can be changed at any time in your settings. |
45 | | - </Text> |
46 | | - <Text variant="body" color="info"> |
47 | | - dev note: Make this more succinct. maybe put some in an info window. |
48 | | - </Text> |
49 | | - </Box> |
50 | | - <Button title="Finish" variant="primary" fullWidth onPress={finish} /> |
51 | | - </Box> |
52 | | - </Screen> |
53 | | - ); |
54 | | -} |
55 | | - |
56 | | -function ModerationCategory({ |
57 | | - label, |
58 | | - value, |
59 | | - onChange, |
60 | | -}: { |
61 | | - label: string; |
62 | | - value: ModerationLevel; |
63 | | - onChange: (level: ModerationLevel) => void; |
64 | | -}) { |
65 | | - return ( |
66 | | - <Box gap="sm"> |
67 | | - <Text variant="body" fontWeight="semibold"> |
68 | | - {label} |
69 | | - </Text> |
70 | | - <Box flexDirection="row" gap="sm"> |
71 | | - {([1, 2, 3] as ModerationLevel[]).map((level) => ( |
72 | | - <Button |
73 | | - key={level} |
74 | | - title={MODERATION_LABELS[level]} |
75 | | - variant={value === level ? 'secondary' : 'tertiary'} |
76 | | - size="sm" |
77 | | - onPress={() => onChange(level)} |
78 | | - /> |
79 | | - ))} |
80 | | - </Box> |
81 | | - </Box> |
82 | | - ); |
83 | | -} |
| 1 | +export { default } from '@/src/features/onboarding/SetModerationScreen'; |
0 commit comments