Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | 2x 1x 2x | import { router } from 'expo-router';
import { Card, Text, XStack, YStack } from 'tamagui';
import { IconSymbol } from '@/src/components/ui/IconSymbol';
import { primaryScale } from '@/src/design-system/tokens';
interface AdminUpdatePromptProps {
catfoodId: number;
catfoodName: string;
}
export function AdminUpdatePrompt({ catfoodId, catfoodName }: AdminUpdatePromptProps) {
const handleUpdateIngredients = () => {
router.push({
pathname: '/(tabs)/scanner',
params: {
catfoodId: String(catfoodId),
catfoodName,
scanType: 'ingredients',
},
});
};
return (
<Card
size="$2"
bordered
backgroundColor={primaryScale.primary2}
borderColor={primaryScale.primary5}
marginHorizontal="$3"
marginBottom="$3"
paddingVertical="$3"
paddingHorizontal="$3.5"
borderRadius="$4"
borderWidth={1.5}
>
<YStack gap="$2.5">
<XStack alignItems="center" gap="$2">
<IconSymbol name="crown.fill" size={18} color={primaryScale.primary9} />
<Text fontSize="$3" color={primaryScale.primary10} fontWeight="700">
管理员权限
</Text>
</XStack>
<Text fontSize="$2" color={primaryScale.primary10} lineHeight={18}>
可以重新扫描并覆盖更新已有的营养成分数据
</Text>
<XStack
paddingVertical="$2.5"
paddingHorizontal="$3.5"
backgroundColor={primaryScale.primary8}
borderRadius="$3"
alignItems="center"
justifyContent="center"
gap="$2"
pressStyle={{
opacity: 0.8,
scale: 0.98,
}}
onPress={handleUpdateIngredients}
>
<IconSymbol name="arrow.triangle.2.circlepath" size={18} color="white" />
<Text fontSize="$3" color="white" fontWeight="700">
重新扫描更新
</Text>
</XStack>
</YStack>
</Card>
);
}
|