Header styles

This commit is contained in:
Eric Bailey
2024-06-13 10:04:06 -05:00
parent 8565a5222e
commit 6bad2e9d4f
+26 -11
View File
@@ -26,37 +26,45 @@ import {
FeedFeedLoadingPlaceholder, FeedFeedLoadingPlaceholder,
ProfileCardFeedLoadingPlaceholder, ProfileCardFeedLoadingPlaceholder,
} from 'view/com/util/LoadingPlaceholder' } from 'view/com/util/LoadingPlaceholder'
import {atoms as a, useTheme} from '#/alf' import {atoms as a, useTheme, ViewStyleProp} from '#/alf'
import {Button} from '#/components/Button' import {Button} from '#/components/Button'
import {ArrowBottom_Stroke2_Corner0_Rounded as ArrowBottom} from '#/components/icons/Arrow' import {ArrowBottom_Stroke2_Corner0_Rounded as ArrowBottom} from '#/components/icons/Arrow'
import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo' import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo'
import {Props as SVGIconProps} from '#/components/icons/common'
import {ListSparkle_Stroke2_Corner0_Rounded as ListSparkle} from '#/components/icons/ListSparkle'
import {UserCircle_Stroke2_Corner0_Rounded as Person} from '#/components/icons/UserCircle'
import {Loader} from '#/components/Loader' import {Loader} from '#/components/Loader'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
function SuggestedItemsHeader({ function SuggestedItemsHeader({
title, title,
description, description,
style,
icon: Icon,
}: { }: {
title: string title: string
description: string description: string
}) { icon: React.ComponentType<SVGIconProps>
} & ViewStyleProp) {
const t = useTheme() const t = useTheme()
return ( return (
<View <View
style={[ style={[
isWeb isWeb
? [a.flex_row, a.px_lg, a.py_lg, a.pt_3xl, a.gap_md] ? [a.flex_row, a.px_lg, a.py_lg, a.pt_2xl, a.gap_md]
: [{flexDirection: 'row-reverse'}, a.p_lg, a.pt_2xl, a.gap_md], : [{flexDirection: 'row-reverse'}, a.p_lg, a.pt_2xl, a.gap_md],
{ style,
borderBottomWidth: 4,
borderColor: t.palette.primary_500,
},
]}> ]}>
<View style={[a.flex_1, a.gap_xs]}> <View style={[a.flex_1, a.gap_sm]}>
<Text style={[a.flex_1, a.text_2xl, a.font_bold, t.atoms.text]}> <View style={[a.flex_row, a.align_center, a.gap_sm]}>
{title} <Icon
</Text> size="lg"
fill={t.palette.primary_500}
style={{marginLeft: -2}}
/>
<Text style={[a.text_2xl, a.font_bold, t.atoms.text]}>{title}</Text>
</View>
<Text style={[t.atoms.text_contrast_high, a.leading_snug]}> <Text style={[t.atoms.text_contrast_high, a.leading_snug]}>
{description} {description}
</Text> </Text>
@@ -218,6 +226,8 @@ type ExploreScreenItems =
key: string key: string
title: string title: string
description: string description: string
style?: ViewStyleProp['style']
icon: React.ComponentType<SVGIconProps>
} }
| { | {
type: 'profile' type: 'profile'
@@ -314,6 +324,7 @@ export function Explore() {
description: _( description: _(
msg`Follow more accounts to get connected to your interests and build your network.`, msg`Follow more accounts to get connected to your interests and build your network.`,
), ),
icon: Person,
}, },
] ]
@@ -361,6 +372,8 @@ export function Explore() {
description: _( description: _(
msg`Custom feeds built by the community bring you new experiences and help you find the content you love.`, msg`Custom feeds built by the community bring you new experiences and help you find the content you love.`,
), ),
style: [a.pt_5xl],
icon: ListSparkle,
}) })
if (feeds && preferences) { if (feeds && preferences) {
@@ -446,6 +459,8 @@ export function Explore() {
<SuggestedItemsHeader <SuggestedItemsHeader
title={item.title} title={item.title}
description={item.description} description={item.description}
style={item.style}
icon={item.icon}
/> />
) )
} }