Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOAPPX-441] Uniform text sizes of ListItem… components #363

Merged
merged 5 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ exports[`Test Banner Components Banner Snapshot 1`] = `
{
"color": "#031344",
"fontFamily": "Titillium Sans Pro",
"fontSize": 18,
"fontSize": 17,
"fontStyle": "normal",
"fontWeight": "600",
"lineHeight": 24,
Expand Down
2 changes: 1 addition & 1 deletion src/components/listitems/ListItemAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const ListItemAction = ({
/>
</View>
)}
<View style={{ flexGrow: 1 }}>
<View style={{ flexGrow: 1, flexShrink: 1 }}>
<ButtonText color={mapForegroundColor[variant]}>{label}</ButtonText>
</View>
</Animated.View>
Expand Down
44 changes: 14 additions & 30 deletions src/components/listitems/ListItemRadioWithAmount.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as React from "react";
import { StyleSheet, View } from "react-native";
import { View } from "react-native";
import RNReactNativeHapticFeedback from "react-native-haptic-feedback";
import { IOColors, useIOTheme } from "../../core";
import { Icon } from "../icons";
import { AnimatedRadio } from "../radio/AnimatedRadio";
import { HSpacer, VSpacer } from "../spacer";
import { H6, BodySmall } from "../typography";
import { HStack } from "../stack";
import { BodySmall, H6 } from "../typography";
import { PressableListItemBase } from "./PressableListItemsBase";

export type ListItemRadioWithAmountProps = {
Expand Down Expand Up @@ -55,45 +55,29 @@ export const ListItemRadioWithAmount = ({
}}
>
<View style={{ flexShrink: 1 }}>
<BodySmall
weight="Semibold"
numberOfLines={1}
color={theme["textBody-default"]}
>
<H6 numberOfLines={1} color={theme["textBody-default"]}>
{label}
</BodySmall>
</H6>
{isSuggested && (
<>
<VSpacer size={4} />
<View style={styles.rowCenter}>
<Icon name="sparkles" size={16} color={suggestColor} />
<HSpacer size={4} />
<BodySmall weight="Regular" color={suggestColor}>
{suggestReason}
</BodySmall>
</View>
</>
<HStack space={4} style={{ alignItems: "center" }}>
<Icon name="sparkles" size={16} color={suggestColor} />
<BodySmall weight="Regular" color={suggestColor}>
{suggestReason}
</BodySmall>
</HStack>
)}
</View>
<View
<HStack
space={8}
pointerEvents="none"
accessibilityElementsHidden
importantForAccessibility="no-hide-descendants"
style={{ flexDirection: "row" }}
>
<H6 color={theme["interactiveElem-default"]}>
{formattedAmountString}
</H6>
<HSpacer size={8} />
<AnimatedRadio checked={selected ?? toggleValue} />
</View>
</HStack>
</PressableListItemBase>
);
};

const styles = StyleSheet.create({
rowCenter: {
flexDirection: "row",
alignItems: "center"
}
});
8 changes: 2 additions & 6 deletions src/components/listitems/ListItemTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,9 @@ export const ListItemTransaction = ({
</View>
)}
<View style={{ flexShrink: 1 }}>
<BodySmall
numberOfLines={numberOfLines}
color={theme["textBody-default"]}
weight="Semibold"
>
<H6 numberOfLines={numberOfLines} color={theme["textBody-default"]}>
{title}
</BodySmall>
</H6>
<BodySmall weight="Regular" color={theme["textBody-tertiary"]}>
{subtitle}
</BodySmall>
Expand Down
Loading