Align colors in loading placeholders

This commit is contained in:
Eric Bailey
2025-09-29 15:14:54 -05:00
parent d3dbb94689
commit 13beb135a1
+13 -20
View File
@@ -7,10 +7,8 @@ import {
type ViewStyle, type ViewStyle,
} from 'react-native' } from 'react-native'
import {usePalette} from '#/lib/hooks/usePalette'
import {s} from '#/lib/styles' import {s} from '#/lib/styles'
import {useTheme} from '#/lib/ThemeContext' import {atoms as a, useTheme} from '#/alf'
import {atoms as a, useTheme as useTheme_NEW} from '#/alf'
import {Bubble_Stroke2_Corner2_Rounded as Bubble} from '#/components/icons/Bubble' import {Bubble_Stroke2_Corner2_Rounded as Bubble} from '#/components/icons/Bubble'
import { import {
Heart2_Filled_Stroke2_Corner0_Rounded as HeartIconFilled, Heart2_Filled_Stroke2_Corner0_Rounded as HeartIconFilled,
@@ -27,7 +25,7 @@ export function LoadingPlaceholder({
height: DimensionValue | undefined height: DimensionValue | undefined
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
}) { }) {
const theme = useTheme() const t = useTheme()
return ( return (
<View <View
style={[ style={[
@@ -35,7 +33,7 @@ export function LoadingPlaceholder({
{ {
width, width,
height, height,
backgroundColor: theme.palette.default.backgroundLight, backgroundColor: t.palette.contrast_50,
}, },
style, style,
]} ]}
@@ -48,10 +46,9 @@ export function PostLoadingPlaceholder({
}: { }: {
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
}) { }) {
const t = useTheme_NEW() const t = useTheme()
const pal = usePalette('default')
return ( return (
<View style={[styles.post, pal.view, style]}> <View style={[styles.post, style]}>
<LoadingPlaceholder <LoadingPlaceholder
width={42} width={42}
height={42} height={42}
@@ -137,14 +134,11 @@ export function NotificationLoadingPlaceholder({
}: { }: {
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
}) { }) {
const pal = usePalette('default') const t = useTheme()
return ( return (
<View style={[styles.notification, pal.view, style]}> <View style={[styles.notification, style]}>
<View style={[{width: 60}, a.align_end, a.pr_sm, a.pt_2xs]}> <View style={[{width: 60}, a.align_end, a.pr_sm, a.pt_2xs]}>
<HeartIconFilled <HeartIconFilled size="xl" style={{color: t.palette.contrast_50}} />
size="xl"
style={{color: pal.colors.backgroundLight}}
/>
</View> </View>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<View style={[a.flex_row, s.mb10]}> <View style={[a.flex_row, s.mb10]}>
@@ -184,9 +178,8 @@ export function ProfileCardLoadingPlaceholder({
}: { }: {
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
}) { }) {
const pal = usePalette('default')
return ( return (
<View style={[styles.profileCard, pal.view, style]}> <View style={[styles.profileCard, style]}>
<LoadingPlaceholder <LoadingPlaceholder
width={40} width={40}
height={40} height={40}
@@ -228,7 +221,7 @@ export function FeedLoadingPlaceholder({
showTopBorder?: boolean showTopBorder?: boolean
showLowerPlaceholder?: boolean showLowerPlaceholder?: boolean
}) { }) {
const pal = usePalette('default') const t = useTheme()
return ( return (
<View <View
style={[ style={[
@@ -236,10 +229,10 @@ export function FeedLoadingPlaceholder({
padding: 16, padding: 16,
borderTopWidth: showTopBorder ? StyleSheet.hairlineWidth : 0, borderTopWidth: showTopBorder ? StyleSheet.hairlineWidth : 0,
}, },
pal.border, t.atoms.border_contrast_low,
style, style,
]}> ]}>
<View style={[pal.view, {flexDirection: 'row'}]}> <View style={[{flexDirection: 'row'}]}>
<LoadingPlaceholder <LoadingPlaceholder
width={36} width={36}
height={36} height={36}
@@ -282,7 +275,7 @@ export function ChatListItemLoadingPlaceholder({
}: { }: {
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
}) { }) {
const t = useTheme_NEW() const t = useTheme()
const random = useMemo(() => Math.random(), []) const random = useMemo(() => Math.random(), [])
return ( return (
<View style={[a.flex_row, a.gap_md, a.px_lg, a.mt_lg, t.atoms.bg, style]}> <View style={[a.flex_row, a.gap_md, a.px_lg, a.mt_lg, t.atoms.bg, style]}>