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 avatar={post.author.avatar} size={30} />
37 </View>
38 <View
39 style={{
40 alignItems: 'center',
41 justifyContent: 'center',
42 width: 34,
43 height: 34,
44 borderRadius: 18,
45 backgroundColor: t.atoms.bg.backgroundColor,
46 }}>
47 <UserAvatar avatar={post.author.avatar} size={30} />
48 </View>
49 </View>
50 <View style={[a.px_sm]}>
51 <Text style={[{color: t.palette.primary_500}, a.text_md]}>
52 <Trans>Continue thread...</Trans>
53 </Text>
54 </View>
55 </Link>
56 )
57}