mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import {View} from 'react-native' 2import * as Progress from 'react-native-progress' 3 4import {atoms as a, useTheme} from '#/alf' 5import {AnimatedCheck} from '../anim/AnimatedCheck' 6import {Text} from '../Typography' 7 8export function ProgressGuideTask({ 9 current, 10 total, 11 title, 12 subtitle, 13}: { 14 current: number 15 total: number 16 title: string 17 subtitle?: string 18}) { 19 const t = useTheme() 20 21 return ( 22 <View style={[a.flex_row, a.gap_sm, !subtitle && a.align_center]}> 23 {current === total ? ( 24 <AnimatedCheck playOnMount fill={t.palette.primary_500} width={20} /> 25 ) : ( 26 <Progress.Circle 27 progress={current / total} 28 color={t.palette.primary_400} 29 size={20} 30 thickness={3} 31 borderWidth={0} 32 unfilledColor={t.palette.contrast_50} 33 /> 34 )} 35 36 <View style={[a.flex_col, a.gap_2xs, {marginTop: -2}]}> 37 <Text style={[a.text_sm, a.font_bold, a.leading_tight]}>{title}</Text> 38 {subtitle && ( 39 <Text 40 style={[a.text_sm, t.atoms.text_contrast_medium, a.leading_tight]}> 41 {subtitle} 42 </Text> 43 )} 44 </View> 45 </View> 46 ) 47}