1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Small fixes

This commit is contained in:
Zhiyuan Zheng
2021-03-27 00:47:14 +01:00
parent 516bb1e67d
commit 80e23d8a31
3 changed files with 21 additions and 9 deletions

View File

@ -235,7 +235,7 @@ const ParseHTML = React.memo(
const [expanded, setExpanded] = useState(false)
const onTextLayout = useCallback(({ nativeEvent }) => {
if (nativeEvent.lines.length >= numberOfLines) {
if (nativeEvent.lines.length >= numberOfLines + 5) {
setExpandAllow(true)
}
}, [])
@ -245,7 +245,9 @@ const ParseHTML = React.memo(
<Text
children={children}
onTextLayout={onTextLayout}
numberOfLines={expanded ? 999 : numberOfLines}
numberOfLines={
expandAllow ? (expanded ? 999 : numberOfLines) : undefined
}
/>
{expandAllow ? (
<Pressable