forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {Fragment} from 'react'
2import {View} from 'react-native'
3import {type ModerationCause} from '@atproto/api'
4import {msg} from '@lingui/core/macro'
5import {useLingui} from '@lingui/react'
6
7import {listUriToHref} from '#/lib/strings/url-helpers'
8import {atoms as a, useTheme} from '#/alf'
9import * as Dialog from '#/components/Dialog'
10import {type DialogControlProps} from '#/components/Dialog'
11import {InlineLinkText} from '#/components/Link'
12import * as Prompt from '#/components/Prompt'
13import {Text} from '#/components/Typography'
14
15export function BlockedByListDialog({
16 control,
17 listBlocks,
18}: {
19 control: DialogControlProps
20 listBlocks: ModerationCause[]
21}) {
22 const {_} = useLingui()
23 const t = useTheme()
24
25 return (
26 <Prompt.Outer control={control} testID="blockedByListDialog">
27 <Prompt.TitleText>{_(msg`User blocked by list`)}</Prompt.TitleText>
28 <View style={[a.gap_sm, a.pb_lg]}>
29 <Text
30 selectable
31 style={[a.text_md, a.leading_snug, t.atoms.text_contrast_high]}>
32 {_(
33 msg`This account is blocked by one or more of your moderation lists. To unblock, please visit the lists directly and remove this user.`,
34 )}{' '}
35 </Text>
36
37 <Text style={[a.text_md, a.leading_snug, t.atoms.text_contrast_high]}>
38 {_(msg`Lists blocking this user:`)}{' '}
39 {listBlocks.map((block, i) =>
40 block.source.type === 'list' ? (
41 <Fragment key={block.source.list.uri}>
42 {i === 0 ? null : ', '}
43 <InlineLinkText
44 label={block.source.list.name}
45 to={listUriToHref(block.source.list.uri)}
46 style={[a.text_md, a.leading_snug]}>
47 {block.source.list.name}
48 </InlineLinkText>
49 </Fragment>
50 ) : null,
51 )}
52 </Text>
53 </View>
54 <Prompt.Actions>
55 <Prompt.Action cta={_(msg`I understand`)} onPress={() => {}} />
56 </Prompt.Actions>
57 <Dialog.Close />
58 </Prompt.Outer>
59 )
60}