Skip to content

Commit

Permalink
Support reposts
Browse files Browse the repository at this point in the history
  • Loading branch information
micahlt committed Mar 20, 2024
1 parent 868c972 commit 2f7bd43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/components/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import AutoVideo from './AutoVideo';

const BORDER_RADIUS = 12;

function Post({ post, nav, commentView = false }) {
function Post({ post, nav, commentView = false, repost = false }) {
if (!post) {
return <></>;
}
Expand Down Expand Up @@ -60,7 +60,9 @@ function Post({ post, nav, commentView = false }) {
<Card
onLayout={event => {
setWidth(event.nativeEvent.layout.width);
}}>
}}
mode={repost ? 'outlined' : 'elevated'}
style={repost ? { marginBottom: 10 } : {}}>
<Card.Content>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
{post?.identity?.conversation_icon ? (
Expand Down Expand Up @@ -158,6 +160,10 @@ function Post({ post, nav, commentView = false }) {
</React.Fragment>
))}

{post.quote_post && !repost && (
<Post post={post.quote_post.post} nav={nav} repost={true} />
)}

<View
style={{
flexDirection: 'row',
Expand Down
3 changes: 1 addition & 2 deletions src/screens/HomeScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,7 @@ function HomeScreen({ navigation, route }) {
contentContainerStyle={{ gap: 10, padding: 10 }}
data={uniquePosts}
renderItem={renderItem}
estimatedItemSize={350}
windowSize={10}
estimatedItemSize={450}
onRefresh={() => fetchPosts(true)}
refreshing={loadingPosts}
onEndReachedThreshold={0.5}
Expand Down

0 comments on commit 2f7bd43

Please sign in to comment.