more usage of tamagui primitives

This commit is contained in:
Codex Agent
2025-12-30 16:04:30 +01:00
parent efe2f25b3e
commit d7c2f85eeb
12 changed files with 744 additions and 315 deletions

View File

@@ -83,14 +83,18 @@ export function CTAButton({
}: {
label: string;
onPress: () => void;
tone?: 'primary' | 'ghost';
tone?: 'primary' | 'ghost' | 'danger';
fullWidth?: boolean;
disabled?: boolean;
loading?: boolean;
}) {
const { primary, surface, border, text } = useAdminTheme();
const { primary, surface, border, text, danger } = useAdminTheme();
const isPrimary = tone === 'primary';
const isDanger = tone === 'danger';
const isDisabled = disabled || loading;
const backgroundColor = isDanger ? danger : isPrimary ? primary : surface;
const borderColor = isPrimary || isDanger ? 'transparent' : border;
const labelColor = isPrimary || isDanger ? 'white' : text;
return (
<Pressable
onPress={isDisabled ? undefined : onPress}
@@ -106,11 +110,11 @@ export function CTAButton({
borderRadius={16}
alignItems="center"
justifyContent="center"
backgroundColor={isPrimary ? primary : surface}
borderWidth={isPrimary ? 0 : 1}
borderColor={isPrimary ? 'transparent' : border}
backgroundColor={backgroundColor}
borderWidth={isPrimary || isDanger ? 0 : 1}
borderColor={borderColor}
>
<Text fontSize="$sm" fontWeight="800" color={isPrimary ? 'white' : text}>
<Text fontSize="$sm" fontWeight="800" color={labelColor}>
{label}
</Text>
</XStack>