Refactor chat list implementation (#10059)

This commit is contained in:
Samuel Newman
2026-04-10 09:58:16 -07:00
committed by GitHub
parent 2c717dc1e7
commit 888eca73b3
18 changed files with 773 additions and 398 deletions
+35
View File
@@ -0,0 +1,35 @@
import {type StyleProp, View, type ViewStyle} from 'react-native'
import {
GlassView as ExpoGlassView,
type GlassViewProps as ExpoGlassViewProps,
isGlassEffectAPIAvailable,
isLiquidGlassAvailable,
} from 'expo-glass-effect'
import {useTheme} from '#/alf'
export const IS_GLASS_AVAILABLE =
isLiquidGlassAvailable() && isGlassEffectAPIAvailable()
/**
* Liquid Glass View that uses `expo-glass-effect`
*
* If unavailable, falls back to a regular `View`. Use `fallbackStyle` to customize the fallback appearance.
*/
export const GlassView = IS_GLASS_AVAILABLE ? InnerGlassView : FallbackView
export type GlassViewProps = ExpoGlassViewProps & {
fallbackStyle?: StyleProp<ViewStyle>
}
function InnerGlassView({
fallbackStyle: _fallbackStyle,
...props
}: GlassViewProps) {
const t = useTheme()
return <ExpoGlassView colorScheme={t.scheme} {...props} />
}
function FallbackView({fallbackStyle, style, ...props}: GlassViewProps) {
return <View style={[fallbackStyle, style]} {...props} />
}