Remove other unused components
This commit is contained in:
@@ -1,65 +0,0 @@
|
|||||||
import * as React from 'react'
|
|
||||||
import {View} from 'react-native'
|
|
||||||
import {AppBskyFeedDefs, AtUri} from '@atproto/api'
|
|
||||||
import {Trans} from '@lingui/macro'
|
|
||||||
|
|
||||||
import {makeProfileLink} from '#/lib/routes/links'
|
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
|
||||||
import {Text} from '#/components/Typography'
|
|
||||||
import {Link} from '../util/Link'
|
|
||||||
import {UserAvatar} from '../util/UserAvatar'
|
|
||||||
|
|
||||||
export function PostThreadLoadMore({post}: {post: AppBskyFeedDefs.PostView}) {
|
|
||||||
const t = useTheme()
|
|
||||||
|
|
||||||
const postHref = React.useMemo(() => {
|
|
||||||
const urip = new AtUri(post.uri)
|
|
||||||
return makeProfileLink(post.author, 'post', urip.rkey)
|
|
||||||
}, [post.uri, post.author])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Link
|
|
||||||
href={postHref}
|
|
||||||
style={[a.flex_row, a.align_center, a.py_md, {paddingHorizontal: 14}]}
|
|
||||||
hoverStyle={[t.atoms.bg_contrast_25]}>
|
|
||||||
<View style={[a.flex_row]}>
|
|
||||||
<View
|
|
||||||
style={{
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
width: 34,
|
|
||||||
height: 34,
|
|
||||||
borderRadius: 18,
|
|
||||||
backgroundColor: t.atoms.bg.backgroundColor,
|
|
||||||
marginRight: -20,
|
|
||||||
}}>
|
|
||||||
<UserAvatar
|
|
||||||
avatar={post.author.avatar}
|
|
||||||
size={30}
|
|
||||||
type={post.author.associated?.labeler ? 'labeler' : 'user'}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
<View
|
|
||||||
style={{
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
width: 34,
|
|
||||||
height: 34,
|
|
||||||
borderRadius: 18,
|
|
||||||
backgroundColor: t.atoms.bg.backgroundColor,
|
|
||||||
}}>
|
|
||||||
<UserAvatar
|
|
||||||
avatar={post.author.avatar}
|
|
||||||
size={30}
|
|
||||||
type={post.author.associated?.labeler ? 'labeler' : 'user'}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View style={[a.px_sm]}>
|
|
||||||
<Text style={[{color: t.palette.primary_500}, a.text_md]}>
|
|
||||||
<Trans>Continue thread...</Trans>
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
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 PostThreadShowHiddenReplies({
|
|
||||||
type,
|
|
||||||
onPress,
|
|
||||||
hideTopBorder,
|
|
||||||
}: {
|
|
||||||
type: 'hidden' | 'muted'
|
|
||||||
onPress: () => void
|
|
||||||
hideTopBorder?: boolean
|
|
||||||
}) {
|
|
||||||
const {_} = useLingui()
|
|
||||||
const t = useTheme()
|
|
||||||
const label =
|
|
||||||
type === 'muted' ? _(msg`Show muted replies`) : _(msg`Show hidden 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,
|
|
||||||
!hideTopBorder && 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>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user