Bluesky app fork with some witchin' additions 馃挮
1import {View} from 'react-native'
2import {Trans} from '@lingui/react/macro'
3
4import {useEnableSquareAvatars} from '#/state/preferences/enable-square-avatars'
5import {type ThreadItem} from '#/state/queries/usePostThread/types'
6import {
7 LINEAR_AVI_WIDTH,
8 OUTER_SPACE,
9 REPLY_LINE_WIDTH,
10} from '#/screens/PostThread/const'
11import {atoms as a, useTheme} from '#/alf'
12import {Lock_Stroke2_Corner0_Rounded as LockIcon} from '#/components/icons/Lock'
13import * as Skele from '#/components/Skeleton'
14import {Text} from '#/components/Typography'
15
16export function ThreadItemPostNoUnauthenticated({
17 item,
18}: {
19 item: Extract<ThreadItem, {type: 'threadPostNoUnauthenticated'}>
20}) {
21 const t = useTheme()
22 const enableSquareAvatars = useEnableSquareAvatars()
23
24 return (
25 <View style={[{paddingHorizontal: OUTER_SPACE}]}>
26 <View style={[a.flex_row, {height: 12}]}>
27 <View style={{width: LINEAR_AVI_WIDTH}}>
28 {item.ui.showParentReplyLine && (
29 <View
30 style={[
31 a.mx_auto,
32 a.flex_1,
33 a.mb_xs,
34 {
35 width: REPLY_LINE_WIDTH,
36 backgroundColor: t.atoms.border_contrast_low.borderColor,
37 },
38 ]}
39 />
40 )}
41 </View>
42 </View>
43 <Skele.Row style={[a.align_center, a.gap_md]}>
44 <Skele.Circle
45 size={LINEAR_AVI_WIDTH}
46 style={enableSquareAvatars && {borderRadius: 8}}>
47 <LockIcon size="md" fill={t.atoms.text_contrast_medium.color} />
48 </Skele.Circle>
49
50 <Text style={[a.text_md, a.italic, t.atoms.text_contrast_medium]}>
51 <Trans>
52 This author has chosen to make their posts visible only to people
53 who are signed in.
54 </Trans>
55 </Text>
56 </Skele.Row>
57 <View
58 style={[
59 a.flex_row,
60 a.justify_center,
61 {
62 height: OUTER_SPACE / 1.5,
63 width: LINEAR_AVI_WIDTH,
64 },
65 ]}>
66 {item.ui.showChildReplyLine && (
67 <View
68 style={[
69 a.mt_xs,
70 a.h_full,
71 {
72 width: REPLY_LINE_WIDTH,
73 backgroundColor: t.atoms.border_contrast_low.borderColor,
74 },
75 ]}
76 />
77 )}
78 </View>
79 </View>
80 )
81}