Tighten up the home feed
parent
3ae5f2886b
commit
c9b209c6fd
|
@ -223,7 +223,6 @@ const styles = StyleSheet.create({
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
minHeight: 36,
|
|
||||||
paddingBottom: 8,
|
paddingBottom: 8,
|
||||||
},
|
},
|
||||||
postText: {
|
postText: {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, {useMemo, useState} from 'react'
|
||||||
import {observer} from 'mobx-react-lite'
|
import {observer} from 'mobx-react-lite'
|
||||||
import {StyleSheet, Text, View} from 'react-native'
|
import {StyleSheet, Text, View} from 'react-native'
|
||||||
import Clipboard from '@react-native-clipboard/clipboard'
|
import Clipboard from '@react-native-clipboard/clipboard'
|
||||||
import Svg, {Circle} from 'react-native-svg'
|
import Svg, {Circle, Line} from 'react-native-svg'
|
||||||
import {AtUri} from '../../../third-party/uri'
|
import {AtUri} from '../../../third-party/uri'
|
||||||
import * as PostType from '../../../third-party/api/src/client/types/app/bsky/feed/post'
|
import * as PostType from '../../../third-party/api/src/client/types/app/bsky/feed/post'
|
||||||
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||||
|
@ -19,8 +19,7 @@ import {UserAvatar} from '../util/UserAvatar'
|
||||||
import {s, colors} from '../../lib/styles'
|
import {s, colors} from '../../lib/styles'
|
||||||
import {useStores} from '../../../state'
|
import {useStores} from '../../../state'
|
||||||
|
|
||||||
const TOP_REPLY_LINE_LENGTH = 12
|
const TOP_REPLY_LINE_LENGTH = 8
|
||||||
const REPLYING_TO_LINE_LENGTH = 8
|
|
||||||
|
|
||||||
export const FeedItem = observer(function FeedItem({
|
export const FeedItem = observer(function FeedItem({
|
||||||
item,
|
item,
|
||||||
|
@ -97,7 +96,11 @@ export const FeedItem = observer(function FeedItem({
|
||||||
(!item.repostedBy && !item.trendedBy && item.additionalParentPost?.thread)
|
(!item.repostedBy && !item.trendedBy && item.additionalParentPost?.thread)
|
||||||
const outerStyles = [
|
const outerStyles = [
|
||||||
styles.outer,
|
styles.outer,
|
||||||
isChild ? styles.outerNoTop : undefined,
|
isChild
|
||||||
|
? item._isThreadChild
|
||||||
|
? styles.outerSmallTop
|
||||||
|
: styles.outerNoTop
|
||||||
|
: undefined,
|
||||||
item._isThreadParent ? styles.outerNoBottom : undefined,
|
item._isThreadParent ? styles.outerNoBottom : undefined,
|
||||||
]
|
]
|
||||||
return (
|
return (
|
||||||
|
@ -111,7 +114,14 @@ export const FeedItem = observer(function FeedItem({
|
||||||
/>
|
/>
|
||||||
) : undefined}
|
) : undefined}
|
||||||
<Link style={outerStyles} href={itemHref} title={itemTitle} noFeedback>
|
<Link style={outerStyles} href={itemHref} title={itemTitle} noFeedback>
|
||||||
{isChild && <View style={styles.topReplyLine} />}
|
{isChild && (
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
styles.topReplyLine,
|
||||||
|
item._isThreadChild ? styles.topReplyLineSmallAvi : undefined,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{item._isThreadParent && (
|
{item._isThreadParent && (
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
|
@ -175,13 +185,18 @@ export const FeedItem = observer(function FeedItem({
|
||||||
onDeletePost={onDeletePost}
|
onDeletePost={onDeletePost}
|
||||||
/>
|
/>
|
||||||
) : undefined}
|
) : undefined}
|
||||||
{!item._isThreadChild && replyHref !== '' && (
|
{!isChild && replyHref !== '' && (
|
||||||
<View style={[s.flexRow, s.mb5, {alignItems: 'center'}]}>
|
<View style={[s.flexRow, s.mb2, {alignItems: 'center'}]}>
|
||||||
<Text style={[s.gray5, s.f15, s.mr2]}>Replying to</Text>
|
<FontAwesomeIcon
|
||||||
|
icon="reply"
|
||||||
|
size={9}
|
||||||
|
style={[s.gray4, s.mr5]}
|
||||||
|
/>
|
||||||
|
<Text style={[s.gray4, s.f12, s.mr2]}>Reply to</Text>
|
||||||
<Link href={replyHref} title="Parent post">
|
<Link href={replyHref} title="Parent post">
|
||||||
<UserInfoText
|
<UserInfoText
|
||||||
did={replyAuthorDid}
|
did={replyAuthorDid}
|
||||||
style={[s.f15, s.blue3]}
|
style={[s.f12, s.gray5]}
|
||||||
prefix="@"
|
prefix="@"
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -220,9 +235,17 @@ export const FeedItem = observer(function FeedItem({
|
||||||
noFeedback>
|
noFeedback>
|
||||||
<View style={styles.viewFullThreadDots}>
|
<View style={styles.viewFullThreadDots}>
|
||||||
<Svg width="4" height="30">
|
<Svg width="4" height="30">
|
||||||
<Circle x="2" y="5" r="1.5" fill={colors.gray3} />
|
<Line
|
||||||
<Circle x="2" y="11" r="1.5" fill={colors.gray3} />
|
x1="2"
|
||||||
<Circle x="2" y="17" r="1.5" fill={colors.gray3} />
|
y1="0"
|
||||||
|
x2="2"
|
||||||
|
y2="5"
|
||||||
|
stroke={colors.gray2}
|
||||||
|
strokeWidth="2"
|
||||||
|
/>
|
||||||
|
<Circle x="2" y="10" r="1.5" fill={colors.gray3} />
|
||||||
|
<Circle x="2" y="16" r="1.5" fill={colors.gray3} />
|
||||||
|
<Circle x="2" y="22" r="1.5" fill={colors.gray3} />
|
||||||
</Svg>
|
</Svg>
|
||||||
</View>
|
</View>
|
||||||
<Text style={styles.viewFullThreadText}>View full thread</Text>
|
<Text style={styles.viewFullThreadText}>View full thread</Text>
|
||||||
|
@ -242,26 +265,37 @@ const styles = StyleSheet.create({
|
||||||
},
|
},
|
||||||
outerNoTop: {
|
outerNoTop: {
|
||||||
marginTop: 0,
|
marginTop: 0,
|
||||||
|
paddingTop: 0,
|
||||||
|
borderTopLeftRadius: 0,
|
||||||
|
borderTopRightRadius: 0,
|
||||||
|
},
|
||||||
|
outerSmallTop: {
|
||||||
|
marginTop: 0,
|
||||||
|
paddingTop: 8,
|
||||||
borderTopLeftRadius: 0,
|
borderTopLeftRadius: 0,
|
||||||
borderTopRightRadius: 0,
|
borderTopRightRadius: 0,
|
||||||
},
|
},
|
||||||
outerNoBottom: {
|
outerNoBottom: {
|
||||||
marginBottom: 0,
|
marginBottom: 0,
|
||||||
|
paddingBottom: 0,
|
||||||
borderBottomLeftRadius: 0,
|
borderBottomLeftRadius: 0,
|
||||||
borderBottomRightRadius: 0,
|
borderBottomRightRadius: 0,
|
||||||
},
|
},
|
||||||
topReplyLine: {
|
topReplyLine: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: 34,
|
left: 34,
|
||||||
top: -1 * TOP_REPLY_LINE_LENGTH + 10,
|
top: -1 * TOP_REPLY_LINE_LENGTH,
|
||||||
height: TOP_REPLY_LINE_LENGTH,
|
height: TOP_REPLY_LINE_LENGTH,
|
||||||
borderLeftWidth: 2,
|
borderLeftWidth: 2,
|
||||||
borderLeftColor: colors.gray2,
|
borderLeftColor: colors.gray2,
|
||||||
},
|
},
|
||||||
|
topReplyLineSmallAvi: {
|
||||||
|
height: TOP_REPLY_LINE_LENGTH + 10,
|
||||||
|
},
|
||||||
bottomReplyLine: {
|
bottomReplyLine: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: 34,
|
left: 34,
|
||||||
top: 70,
|
top: 60,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
borderLeftWidth: 2,
|
borderLeftWidth: 2,
|
||||||
borderLeftColor: colors.gray2,
|
borderLeftColor: colors.gray2,
|
||||||
|
@ -292,7 +326,6 @@ const styles = StyleSheet.create({
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
paddingBottom: 8,
|
paddingBottom: 8,
|
||||||
minHeight: 36,
|
|
||||||
},
|
},
|
||||||
postText: {
|
postText: {
|
||||||
fontFamily: 'System',
|
fontFamily: 'System',
|
||||||
|
@ -304,7 +337,8 @@ const styles = StyleSheet.create({
|
||||||
},
|
},
|
||||||
viewFullThread: {
|
viewFullThread: {
|
||||||
backgroundColor: colors.white,
|
backgroundColor: colors.white,
|
||||||
paddingTop: 4,
|
paddingTop: 12,
|
||||||
|
paddingBottom: 4,
|
||||||
paddingLeft: 72,
|
paddingLeft: 72,
|
||||||
},
|
},
|
||||||
viewFullThreadDots: {
|
viewFullThreadDots: {
|
||||||
|
|
Loading…
Reference in New Issue