Bluesky app fork with some witchin' additions 馃挮
at main 63 lines 2.1 kB view raw
1import React 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 29 <View style={[a.gap_sm, a.pb_lg]}> 30 <Text 31 selectable 32 style={[a.text_md, a.leading_snug, t.atoms.text_contrast_high]}> 33 {_( 34 msg`This account is blocked by one or more of your moderation lists. To unblock, please visit the lists directly and remove this user.`, 35 )}{' '} 36 </Text> 37 38 <Text style={[a.text_md, a.leading_snug, t.atoms.text_contrast_high]}> 39 {_(msg`Lists blocking this user:`)}{' '} 40 {listBlocks.map((block, i) => 41 block.source.type === 'list' ? ( 42 <React.Fragment key={block.source.list.uri}> 43 {i === 0 ? null : ', '} 44 <InlineLinkText 45 label={block.source.list.name} 46 to={listUriToHref(block.source.list.uri)} 47 style={[a.text_md, a.leading_snug]}> 48 {block.source.list.name} 49 </InlineLinkText> 50 </React.Fragment> 51 ) : null, 52 )} 53 </Text> 54 </View> 55 56 <Prompt.Actions> 57 <Prompt.Action cta={_(msg`I understand`)} onPress={() => {}} /> 58 </Prompt.Actions> 59 60 <Dialog.Close /> 61 </Prompt.Outer> 62 ) 63}