Remove use of flatten where possible (#9325)

* remove use of flatten where possible

* restore flatten where it says it's needed

* missing utils alpha
This commit is contained in:
Samuel Newman
2025-11-04 15:43:08 +02:00
committed by GitHub
parent 0bcde99025
commit 1b0fbd503e
28 changed files with 67 additions and 97 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import React from 'react'
import {type StyleProp, StyleSheet, View, type ViewStyle} from 'react-native'
import {type StyleProp, View, type ViewStyle} from 'react-native'
import {type AnimatedRef, useAnimatedRef} from 'react-native-reanimated'
import {type AppBskyEmbedImages} from '@atproto/api'
@@ -224,5 +224,5 @@ function noCorners(
if (corners.includes('bottomRight')) {
styles.push({borderBottomRightRadius: 0})
}
return StyleSheet.flatten(styles)
return styles
}
+3 -2
View File
@@ -1,5 +1,5 @@
import React from 'react'
import {StyleSheet, type TextProps} from 'react-native'
import {type TextProps} from 'react-native'
import Svg, {
Defs,
LinearGradient,
@@ -12,6 +12,7 @@ import {Image} from 'expo-image'
import {colors} from '#/lib/styles'
import {useKawaiiMode} from '#/state/preferences/kawaii'
import {flatten} from '#/alf'
const ratio = 57 / 64
@@ -23,7 +24,7 @@ type Props = {
export const Logo = React.forwardRef(function LogoImpl(props: Props, ref) {
const {fill, ...rest} = props
const gradient = fill === 'sky'
const styles = StyleSheet.flatten(props.style)
const styles = flatten(props.style)
const _fill = gradient ? 'url(#sky)' : fill || styles?.color || colors.blue3
// @ts-ignore it's fiiiiine
const size = parseInt(rest.width || 32)