mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import * as React from 'react'
2import {View} from 'react-native'
3import {AppBskyFeedDefs, AtUri} from '@atproto/api'
4import {Trans} from '@lingui/macro'
5
6import {makeProfileLink} from '#/lib/routes/links'
7import {atoms as a, useTheme} from '#/alf'
8import {Text} from '#/components/Typography'
9import {Link} from '../util/Link'
10import {UserAvatar} from '../util/UserAvatar'
11
12export function PostThreadLoadMore({post}: {post: AppBskyFeedDefs.PostView}) {
13 const t = useTheme()
14
15 const postHref = React.useMemo(() => {
16 const urip = new AtUri(post.uri)
17 return makeProfileLink(post.author, 'post', urip.rkey)
18 }, [post.uri, post.author])
19
20 return (
21 <Link
22 href={postHref}
23 style={[a.flex_row, a.align_center, a.py_md, {paddingHorizontal: 14}]}
24 hoverStyle={[t.atoms.bg_contrast_25]}>
25 <View style={[a.flex_row]}>
26 <View
27 style={{
28 alignItems: 'center',
29 justifyContent: 'center',
30 width: 34,
31 height: 34,
32 borderRadius: 18,
33 backgroundColor: t.atoms.bg.backgroundColor,
34 marginRight: -20,
35 }}>
36 <UserAvatar
37 avatar={post.author.avatar}
38 size={30}
39 type={post.author.associated?.labeler ? 'labeler' : 'user'}
40 />
41 </View>
42 <View
43 style={{
44 alignItems: 'center',
45 justifyContent: 'center',
46 width: 34,
47 height: 34,
48 borderRadius: 18,
49 backgroundColor: t.atoms.bg.backgroundColor,
50 }}>
51 <UserAvatar
52 avatar={post.author.avatar}
53 size={30}
54 type={post.author.associated?.labeler ? 'labeler' : 'user'}
55 />
56 </View>
57 </View>
58 <View style={[a.px_sm]}>
59 <Text style={[{color: t.palette.primary_500}, a.text_md]}>
60 <Trans>Continue thread...</Trans>
61 </Text>
62 </View>
63 </Link>
64 )
65}