Placeholder style tweaks (#9107)

* Align colors in loading placeholders

* Same for new skele components

* Increase opacity of disabled replies button slightly
This commit is contained in:
Eric Bailey
2025-10-10 11:16:40 -05:00
committed by GitHub
parent 6cd6a3447d
commit a9efd94983
3 changed files with 17 additions and 24 deletions
+1 -1
View File
@@ -210,7 +210,7 @@ let PostControls = ({
a.flex_1, a.flex_1,
a.align_start, a.align_start,
{marginLeft: big ? -2 : -6}, {marginLeft: big ? -2 : -6},
replyDisabled ? {opacity: 0.5} : undefined, replyDisabled ? {opacity: 0.6} : undefined,
]}> ]}>
<PostControlButton <PostControlButton
testID="replyBtn" testID="replyBtn"
+3 -3
View File
@@ -32,7 +32,7 @@ export function Text({blend, style}: TextStyleProp & SkeletonProps) {
<View <View
style={[ style={[
a.rounded_md, a.rounded_md,
t.atoms.bg_contrast_25, t.atoms.bg_contrast_50,
{ {
height: lineHeight * 0.7, height: lineHeight * 0.7,
opacity: blend ? 0.6 : 1, opacity: blend ? 0.6 : 1,
@@ -57,7 +57,7 @@ export function Circle({
a.justify_center, a.justify_center,
a.align_center, a.align_center,
a.rounded_full, a.rounded_full,
t.atoms.bg_contrast_25, t.atoms.bg_contrast_50,
{ {
width: size, width: size,
height: size, height: size,
@@ -80,7 +80,7 @@ export function Pill({
<View <View
style={[ style={[
a.rounded_full, a.rounded_full,
t.atoms.bg_contrast_25, t.atoms.bg_contrast_50,
{ {
width: size * 1.618, width: size * 1.618,
height: size, height: size,
+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]}>