Adjust getting started card for smaller viewport
This commit is contained in:
committed by
Samuel Newman
parent
599e92861d
commit
a8fd0521e2
@@ -9,7 +9,7 @@ import {
|
|||||||
useProgressGuideControls,
|
useProgressGuideControls,
|
||||||
} from '#/state/shell/progress-guide'
|
} from '#/state/shell/progress-guide'
|
||||||
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useLayoutBreakpoints, useTheme} from '#/alf'
|
||||||
import {Button, ButtonIcon} from '#/components/Button'
|
import {Button, ButtonIcon} from '#/components/Button'
|
||||||
import {Person_Stroke2_Corner2_Rounded as PersonIcon} from '#/components/icons/Person'
|
import {Person_Stroke2_Corner2_Rounded as PersonIcon} from '#/components/icons/Person'
|
||||||
import {TimesLarge_Stroke2_Corner0_Rounded as Times} from '#/components/icons/Times'
|
import {TimesLarge_Stroke2_Corner0_Rounded as Times} from '#/components/icons/Times'
|
||||||
@@ -46,11 +46,8 @@ export function ProgressGuideList({style}: {style?: StyleProp<ViewStyle>}) {
|
|||||||
a.gap_md,
|
a.gap_md,
|
||||||
a.rounded_md,
|
a.rounded_md,
|
||||||
t.atoms.bg_contrast_25,
|
t.atoms.bg_contrast_25,
|
||||||
|
a.p_lg,
|
||||||
style,
|
style,
|
||||||
a.pt_sm,
|
|
||||||
a.pr_sm,
|
|
||||||
a.pb_md,
|
|
||||||
a.pl_md,
|
|
||||||
]}>
|
]}>
|
||||||
<View style={[a.flex_row, a.align_center, a.justify_between]}>
|
<View style={[a.flex_row, a.align_center, a.justify_between]}>
|
||||||
<Text style={[t.atoms.text, a.font_semi_bold, a.text_md]}>
|
<Text style={[t.atoms.text, a.font_semi_bold, a.text_md]}>
|
||||||
@@ -97,8 +94,12 @@ export function ProgressGuideList({style}: {style?: StyleProp<ViewStyle>}) {
|
|||||||
|
|
||||||
function StackedAvatars({follows}: {follows?: {avatar?: string}[]}) {
|
function StackedAvatars({follows}: {follows?: {avatar?: string}[]}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const avatarSize = 38
|
const {centerColumnOffset} = useLayoutBreakpoints()
|
||||||
const overlap = 11
|
|
||||||
|
// Smaller avatars for narrower viewport
|
||||||
|
const avatarSize = centerColumnOffset ? 30 : 37
|
||||||
|
const overlap = centerColumnOffset ? 9 : 11
|
||||||
|
const iconSize = centerColumnOffset ? 14 : 18
|
||||||
|
|
||||||
// Use actual follows count, not the guide's event counter
|
// Use actual follows count, not the guide's event counter
|
||||||
const followedAvatars = follows?.slice(0, TOTAL_AVATARS) ?? []
|
const followedAvatars = follows?.slice(0, TOTAL_AVATARS) ?? []
|
||||||
@@ -151,8 +152,8 @@ function StackedAvatars({follows}: {follows?: {avatar?: string}[]}) {
|
|||||||
},
|
},
|
||||||
]}>
|
]}>
|
||||||
<PersonIcon
|
<PersonIcon
|
||||||
width={18}
|
width={iconSize}
|
||||||
height={18}
|
height={iconSize}
|
||||||
fill={t.atoms.text_contrast_low.color}
|
fill={t.atoms.text_contrast_low.color}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -42,16 +42,8 @@ function Inner() {
|
|||||||
return error || noTopics ? null : (
|
return error || noTopics ? null : (
|
||||||
<>
|
<>
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[a.p_lg, a.rounded_md, a.border, t.atoms.border_contrast_low]}>
|
||||||
a.pt_sm,
|
<View style={[a.flex_row, a.align_center, a.gap_xs, a.pb_md]}>
|
||||||
a.pr_sm,
|
|
||||||
a.pb_md,
|
|
||||||
a.pl_md,
|
|
||||||
a.rounded_md,
|
|
||||||
a.border,
|
|
||||||
t.atoms.border_contrast_low,
|
|
||||||
]}>
|
|
||||||
<View style={[a.flex_row, a.align_center, a.gap_xs, a.pb_sm]}>
|
|
||||||
<TrendingIcon width={16} height={16} fill={t.atoms.text.color} />
|
<TrendingIcon width={16} height={16} fill={t.atoms.text.color} />
|
||||||
<Text style={[a.flex_1, a.text_md, a.font_semi_bold, t.atoms.text]}>
|
<Text style={[a.flex_1, a.text_md, a.font_semi_bold, t.atoms.text]}>
|
||||||
<Trans>Trending</Trans>
|
<Trans>Trending</Trans>
|
||||||
|
|||||||
Reference in New Issue
Block a user