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

Fix remove reply level not showing up correctly

This commit is contained in:
xmflsct
2023-01-09 16:52:29 +01:00
parent 1025d85ae5
commit cd7e740ab1

View File

@ -257,7 +257,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
} }
) )
const heights = useRef<(number | undefined)[]>([]) const [heights, setHeights] = useState<{ [key: number]: number }>({})
const MAX_LEVEL = 10 const MAX_LEVEL = 10
const ARC = StyleConstants.Avatar.XS / 4 const ARC = StyleConstants.Avatar.XS / 4
@ -284,7 +284,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
nativeEvent: { nativeEvent: {
layout: { height } layout: { height }
} }
}) => (heights.current[index] = height)} }) => setHeights({ ...heights, [index]: height })}
> >
<TimelineDefault <TimelineDefault
item={item} item={item}
@ -326,7 +326,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
d={ d={
`M ${(i + 1) * StyleConstants.Spacing.S} 0 ` + `M ${(i + 1) * StyleConstants.Spacing.S} 0 ` +
`v ${ `v ${
(heights.current[index] || 999) - (heights[index] || 999) -
(StyleConstants.Spacing.S * 1.5 + StyleConstants.Font.Size.L) / 2 - (StyleConstants.Spacing.S * 1.5 + StyleConstants.Font.Size.L) / 2 -
StyleConstants.Avatar.XS / 2 StyleConstants.Avatar.XS / 2
} ` + } ` +
@ -347,7 +347,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
d={ d={
`M ${(i + 1) * StyleConstants.Spacing.S} 0 ` + `M ${(i + 1) * StyleConstants.Spacing.S} 0 ` +
`v ${ `v ${
(heights.current[index] || 999) - (heights[index] || 999) -
(StyleConstants.Spacing.S * 1.5 + (StyleConstants.Spacing.S * 1.5 +
StyleConstants.Font.Size.L * 1.35) / StyleConstants.Font.Size.L * 1.35) /
2 2
@ -355,7 +355,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
`h ${ARC}` `h ${ARC}`
} }
strokeWidth={1} strokeWidth={1}
stroke={colors.border} stroke={colors.red}
strokeOpacity={0.6} strokeOpacity={0.6}
/> />
</Svg> </Svg>
@ -375,7 +375,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
} }
}) })
: null} : null}
{/* <CustomText <CustomText
children={query.data?.pages[0].body[index - 1]?._level} children={query.data?.pages[0].body[index - 1]?._level}
style={{ position: 'absolute', top: 4, left: 4, color: colors.red }} style={{ position: 'absolute', top: 4, left: 4, color: colors.red }}
/> />
@ -386,7 +386,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
<CustomText <CustomText
children={query.data?.pages[0].body[index + 1]?._level} children={query.data?.pages[0].body[index + 1]?._level}
style={{ position: 'absolute', top: 36, left: 4, color: colors.green }} style={{ position: 'absolute', top: 36, left: 4, color: colors.green }}
/> */} />
</View> </View>
) )
}} }}