diff --git a/src/view/com/composer/char-progress/CharProgress.tsx b/src/view/com/composer/char-progress/CharProgress.tsx index d437472902..f35d9b50a7 100644 --- a/src/view/com/composer/char-progress/CharProgress.tsx +++ b/src/view/com/composer/char-progress/CharProgress.tsx @@ -4,18 +4,15 @@ import { View, type ViewStyle, } from 'react-native' -// @ts-ignore no type definition -prf -import ProgressCircle from 'react-native-progress/Circle' -// @ts-ignore no type definition -prf -import ProgressPie from 'react-native-progress/Pie' import {MAX_GRAPHEME_LENGTH} from '#/lib/constants' import {atoms as a, useTheme} from '#/alf' +import {ProgressCircle} from '#/components/Progress' import {Text} from '#/components/Typography' export function CharProgress({ count, - max, + max = MAX_GRAPHEME_LENGTH, style, textStyle, size, @@ -26,40 +23,42 @@ export function CharProgress({ textStyle?: StyleProp size?: number }) { - const maxLength = max || MAX_GRAPHEME_LENGTH const t = useTheme() - const textColor = count > maxLength ? '#e60000' : t.atoms.text.color - const circleColor = count > maxLength ? '#e60000' : t.palette.primary_500 + const textColor = count > max ? '#e60000' : t.atoms.text.color + const circleColor = count > max ? '#e60000' : t.palette.primary_500 return ( - - - {maxLength - count} - - {count > maxLength ? ( - - ) : ( - + + {max - count < 100 && ( + + + {max - count} + + )} + ) }