Replace show more
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import {View} from 'react-native'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {Button} from '#/components/Button'
|
||||
import {EyeSlash_Stroke2_Corner0_Rounded as EyeSlash} from '#/components/icons/EyeSlash'
|
||||
import {Text} from '#/components/Typography'
|
||||
|
||||
export function ThreadItemShowOtherReplies({onPress}: {onPress: () => void}) {
|
||||
const {_} = useLingui()
|
||||
const t = useTheme()
|
||||
const label = _(msg`Show more replies`)
|
||||
|
||||
return (
|
||||
<Button onPress={onPress} label={label}>
|
||||
{({hovered, pressed}) => (
|
||||
<View
|
||||
style={[
|
||||
a.flex_1,
|
||||
a.flex_row,
|
||||
a.align_center,
|
||||
a.gap_sm,
|
||||
a.py_lg,
|
||||
a.px_xl,
|
||||
a.border_t,
|
||||
t.atoms.border_contrast_low,
|
||||
hovered || pressed ? t.atoms.bg_contrast_25 : t.atoms.bg,
|
||||
]}>
|
||||
<View
|
||||
style={[
|
||||
t.atoms.bg_contrast_25,
|
||||
a.align_center,
|
||||
a.justify_center,
|
||||
{
|
||||
width: 26,
|
||||
height: 26,
|
||||
borderRadius: 13,
|
||||
marginRight: 4,
|
||||
},
|
||||
]}>
|
||||
<EyeSlash size="sm" fill={t.atoms.text_contrast_medium.color} />
|
||||
</View>
|
||||
<Text
|
||||
style={[t.atoms.text_contrast_medium, a.flex_1, a.leading_snug]}
|
||||
numberOfLines={1}>
|
||||
{label}
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import {isNative} from '#/platform/detection'
|
||||
import {type ThreadItem, usePostThread} from '#/state/queries/usePostThread'
|
||||
import {type OnPostSuccessData} from '#/state/shell/composer'
|
||||
import {PostThreadComposePrompt} from '#/view/com/post-thread/PostThreadComposePrompt'
|
||||
import {PostThreadShowHiddenReplies} from '#/view/com/post-thread/PostThreadShowHiddenReplies'
|
||||
import {List, type ListMethods} from '#/view/com/util/List'
|
||||
import {HeaderDropdown} from '#/screens/PostThread/components/HeaderDropdown'
|
||||
import {
|
||||
@@ -26,6 +25,7 @@ import {ThreadItemPostTombstone} from '#/screens/PostThread/components/ThreadIte
|
||||
import {ThreadItemReadMore} from '#/screens/PostThread/components/ThreadItemReadMore'
|
||||
import {ThreadItemReadMoreUp} from '#/screens/PostThread/components/ThreadItemReadMoreUp'
|
||||
import {ThreadItemReplyComposerSkeleton} from '#/screens/PostThread/components/ThreadItemReplyComposer'
|
||||
import {ThreadItemShowOtherReplies} from '#/screens/PostThread/components/ThreadItemShowOtherReplies'
|
||||
import {
|
||||
ThreadItemTreePost,
|
||||
ThreadItemTreePostSkeleton,
|
||||
@@ -291,9 +291,7 @@ export function Inner({uri}: {uri: string | undefined}) {
|
||||
</View>
|
||||
)
|
||||
} else if (item.type === 'showOtherReplies') {
|
||||
return (
|
||||
<PostThreadShowHiddenReplies type="hidden" onPress={item.onPress} />
|
||||
)
|
||||
return <ThreadItemShowOtherReplies onPress={item.onPress} />
|
||||
} else if (item.type === 'skeleton') {
|
||||
if (item.item === 'anchor') {
|
||||
return <ThreadAnchorSkeleton />
|
||||
|
||||
Reference in New Issue
Block a user