Something went wrong. Try again.
Mirror — see github.com/blacksky-algorithms/blacksky.community
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169import { type DimensionValue, type StyleProp, StyleSheet, View, type ViewStyle,} from 'react-native'
import {s} from '#/lib/styles'import {atoms as a, useTheme} from '#/alf'import {Heart2_Filled_Stroke2_Corner0_Rounded as HeartIconFilled} from '#/components/icons/Heart2'
export function LoadingPlaceholder({ width, height, style,}: { width: DimensionValue height: DimensionValue | undefined style?: StyleProp<ViewStyle>}) { const t = useTheme() return ( <View style={[ styles.loadingPlaceholder, { width, height, backgroundColor: t.palette.contrast_50, }, style, ]} /> )}
export function NotificationLoadingPlaceholder({ style,}: { style?: StyleProp<ViewStyle>}) { const t = useTheme() return ( <View style={[styles.notification, style]}> <View style={[{width: 60}, a.align_end, a.pr_sm, a.pt_2xs]}> <HeartIconFilled size="xl" style={{color: t.palette.contrast_50}} /> </View> <View style={{flex: 1}}> <View style={[a.flex_row, s.mb10]}> <LoadingPlaceholder width={35} height={35} style={styles.smallAvatar} /> </View> <LoadingPlaceholder width="90%" height={6} style={[s.mb5]} /> <LoadingPlaceholder width="70%" height={6} style={[s.mb5]} /> </View> </View> )}
export function NotificationFeedLoadingPlaceholder() { return ( <> <NotificationLoadingPlaceholder /> <NotificationLoadingPlaceholder /> <NotificationLoadingPlaceholder /> <NotificationLoadingPlaceholder /> <NotificationLoadingPlaceholder /> <NotificationLoadingPlaceholder /> <NotificationLoadingPlaceholder /> <NotificationLoadingPlaceholder /> <NotificationLoadingPlaceholder /> <NotificationLoadingPlaceholder /> <NotificationLoadingPlaceholder /> </> )}
export function ProfileCardLoadingPlaceholder({ style,}: { style?: StyleProp<ViewStyle>}) { return ( <View style={[styles.profileCard, style]}> <LoadingPlaceholder width={40} height={40} style={styles.profileCardAvi} /> <View> <LoadingPlaceholder width={140} height={8} style={[s.mb5]} /> <LoadingPlaceholder width={120} height={8} style={[s.mb10]} /> <LoadingPlaceholder width={220} height={8} style={[s.mb5]} /> </View> </View> )}
export function ProfileCardFeedLoadingPlaceholder() { return ( <> <ProfileCardLoadingPlaceholder /> <ProfileCardLoadingPlaceholder /> <ProfileCardLoadingPlaceholder /> <ProfileCardLoadingPlaceholder /> <ProfileCardLoadingPlaceholder /> <ProfileCardLoadingPlaceholder /> <ProfileCardLoadingPlaceholder /> <ProfileCardLoadingPlaceholder /> <ProfileCardLoadingPlaceholder /> <ProfileCardLoadingPlaceholder /> <ProfileCardLoadingPlaceholder /> </> )}
const styles = StyleSheet.create({ loadingPlaceholder: { borderRadius: 6, }, post: { flexDirection: 'row', alignItems: 'flex-start', paddingHorizontal: 10, paddingTop: 20, paddingBottom: 5, paddingRight: 15, }, postCtrls: { opacity: 0.5, flexDirection: 'row', justifyContent: 'space-between', }, postCtrl: { flex: 1, }, postBtn: { flex: 1, flexDirection: 'row', alignItems: 'center', padding: 5, }, avatar: { borderRadius: 999, marginRight: 12, }, notification: { flexDirection: 'row', padding: 10, }, profileCard: { flexDirection: 'row', padding: 10, margin: 1, }, profileCardAvi: { borderRadius: 999, marginRight: 10, }, smallAvatar: { borderRadius: 999, marginRight: 10, },})