upd: redesign

This commit is contained in:
2026-02-18 17:26:19 +08:00
parent 31b7cf6a30
commit 4681f0a0cc
7 changed files with 89 additions and 74 deletions

View File

@@ -18,17 +18,14 @@ type Props = {
rightBottomInfo?: React.ReactNode | string
titleWeight?: 'normal' | 'bold'
bgColor?: string
width?: number
descEllipsize?: boolean
textColor?: string,
colorPress?: boolean
titleShowAll?: boolean
}
export default function BorderBottomItem({ title, subtitle, icon, desc, onPress, onLongPress, rightTopInfo, borderType, leftBottomInfo, rightBottomInfo, titleWeight, bgColor, width, descEllipsize, textColor, colorPress, titleShowAll }: Props) {
const lebarDim = Dimensions.get("window").width;
export default function BorderBottomItem({ title, subtitle, icon, desc, onPress, onLongPress, rightTopInfo, borderType, leftBottomInfo, rightBottomInfo, titleWeight, bgColor, descEllipsize, textColor, colorPress, titleShowAll }: Props) {
const { colors } = useTheme();
const lebar = width ? lebarDim * width / 100 : 'auto';
const textColorFix = textColor ? textColor : colors.text;
const [isTap, setIsTap] = useState(false);
@@ -50,8 +47,8 @@ export default function BorderBottomItem({ title, subtitle, icon, desc, onPress,
>
<View style={[Styles.rowItemsCenter]}>
{icon}
<View style={[Styles.rowSpaceBetween, width ? { width: lebar } : { width: '88%' }]}>
<View style={[Styles.ml10, rightTopInfo ? { width: '70%' } : { width: '90%' }]}>
<View style={[Styles.rowSpaceBetween, Styles.flex1]}>
<View style={[Styles.ml10, Styles.flex1, Styles.mr10]}>
<Text style={[titleWeight == 'normal' ? Styles.textDefault : Styles.textDefaultSemiBold, { color: textColorFix }]} numberOfLines={titleShowAll ? 0 : 1} ellipsizeMode='tail'>{title}</Text>
{
subtitle &&
@@ -81,7 +78,7 @@ export default function BorderBottomItem({ title, subtitle, icon, desc, onPress,
}
{
typeof rightBottomInfo == 'string' ?
<Text style={[Styles.textInformation, {color: colors.dimmed }]}>{rightBottomInfo}</Text>
<Text style={[Styles.textInformation, { color: colors.dimmed }]}>{rightBottomInfo}</Text>
:
rightBottomInfo
}