Do less work (#1953)
This commit is contained in:
parent
9c8a1b8a31
commit
c858b58307
6 changed files with 24 additions and 29 deletions
|
@ -1,4 +1,4 @@
|
|||
import React, {useMemo} from 'react'
|
||||
import React, {memo, useMemo} from 'react'
|
||||
import {StyleSheet, View} from 'react-native'
|
||||
import {
|
||||
AtUri,
|
||||
|
@ -118,7 +118,7 @@ function PostThreadItemDeleted() {
|
|||
)
|
||||
}
|
||||
|
||||
function PostThreadItemLoaded({
|
||||
let PostThreadItemLoaded = ({
|
||||
post,
|
||||
record,
|
||||
richText,
|
||||
|
@ -144,12 +144,12 @@ function PostThreadItemLoaded({
|
|||
showParentReplyLine?: boolean
|
||||
hasPrecedingItem: boolean
|
||||
onPostReply: () => void
|
||||
}) {
|
||||
}): React.ReactNode => {
|
||||
const pal = usePalette('default')
|
||||
const langPrefs = useLanguagePrefs()
|
||||
const {openComposer} = useComposerControls()
|
||||
const [limitLines, setLimitLines] = React.useState(
|
||||
countLines(richText?.text) >= MAX_POST_LINES,
|
||||
() => countLines(richText?.text) >= MAX_POST_LINES,
|
||||
)
|
||||
const styles = useStyles()
|
||||
const hasEngagement = post.likeCount || post.repostCount
|
||||
|
@ -565,6 +565,7 @@ function PostThreadItemLoaded({
|
|||
)
|
||||
}
|
||||
}
|
||||
PostThreadItemLoaded = memo(PostThreadItemLoaded)
|
||||
|
||||
function PostOuterWrapper({
|
||||
post,
|
||||
|
|
|
@ -99,7 +99,7 @@ function PostInner({
|
|||
const pal = usePalette('default')
|
||||
const {openComposer} = useComposerControls()
|
||||
const [limitLines, setLimitLines] = useState(
|
||||
countLines(richText?.text) >= MAX_POST_LINES,
|
||||
() => countLines(richText?.text) >= MAX_POST_LINES,
|
||||
)
|
||||
const itemUrip = new AtUri(post.uri)
|
||||
const itemHref = makeProfileLink(post.author, 'post', itemUrip.rkey)
|
||||
|
|
|
@ -106,7 +106,7 @@ let FeedItemInner = ({
|
|||
const pal = usePalette('default')
|
||||
const {track} = useAnalytics()
|
||||
const [limitLines, setLimitLines] = useState(
|
||||
countLines(richText.text) >= MAX_POST_LINES,
|
||||
() => countLines(richText.text) >= MAX_POST_LINES,
|
||||
)
|
||||
|
||||
const href = useMemo(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue