Fix react-native-svg default fill black

This commit is contained in:
xmflsct 2023-01-25 00:29:36 +01:00
parent 9d9c16df06
commit 2d91d1f7fb
3 changed files with 9 additions and 10 deletions

View File

@ -68,7 +68,7 @@ const Sparkline: React.FC<Props> = ({ data, width, height, margin = 0 }) => {
const fillPoints = linePoints.concat(closePolyPoints)
return (
<Svg height={height} width={width} style={{ marginRight: margin }}>
<Svg height={height} width={width} style={{ marginRight: margin }} fill='none'>
<G>
<Path d={'M' + fillPoints.join(' ')} fill={colors.blue} fillOpacity={0.1} />
<Path

View File

@ -145,12 +145,12 @@ const Timeline: React.FC<Props> = ({
ref={customFLRef || flRef}
scrollEventThrottle={16}
onScroll={onScroll}
windowSize={7}
windowSize={5}
data={flattenPages(data)}
{...(customProps?.renderItem
? { renderItem: customProps.renderItem }
: { renderItem: ({ item }) => <TimelineDefault item={item} queryKey={queryKey} /> })}
initialNumToRender={6}
initialNumToRender={3}
maxToRenderPerBatch={3}
onEndReached={() => !disableInfinity && !isFetchingNextPage && fetchNextPage()}
onEndReachedThreshold={0.75}

View File

@ -306,8 +306,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
return (
<FlatList
ref={flRef}
scrollEventThrottle={16}
windowSize={7}
windowSize={5}
data={query.data?.pages?.[0].body}
renderItem={({ item, index }) => {
const prev = query.data?.pages[0].body[index - 1]?._level || 0
@ -334,7 +333,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
return null
}
return (
<Svg key={i} style={{ position: 'absolute' }}>
<Svg key={i} style={{ position: 'absolute' }} fill='none'>
<Path
d={
`M ${curr * StyleConstants.Spacing.S + ARC} ${
@ -352,7 +351,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
} else {
if (i >= curr - 2) return null
return (
<Svg key={i} style={{ position: 'absolute' }}>
<Svg key={i} style={{ position: 'absolute' }} fill='none'>
<Path
d={
`M ${(i + 1) * StyleConstants.Spacing.S} 0 ` +
@ -373,7 +372,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
} else {
if (i >= next - 1) {
return (
<Svg key={i} style={{ position: 'absolute' }}>
<Svg key={i} style={{ position: 'absolute' }} fill='none'>
<Path
d={
`M ${(i + 1) * StyleConstants.Spacing.S} 0 ` +
@ -393,7 +392,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
)
} else {
return (
<Svg key={i} style={{ position: 'absolute' }}>
<Svg key={i} style={{ position: 'absolute' }} fill='none'>
<Path
d={`M ${(i + 1) * StyleConstants.Spacing.S} 0 ` + `v 999`}
strokeWidth={1}
@ -428,7 +427,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
</View>
)
}}
initialNumToRender={6}
initialNumToRender={3}
maxToRenderPerBatch={3}
ItemSeparatorComponent={({ leadingItem }) => {
return (