mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 02:19:41 +02:00
Migrate figgos from single Expo app to multi-app monorepo structure: - Move mobile app to apps/mobile/ - Add apps/web/ (SvelteKit) and apps/backend/ (NestJS) scaffolds - Add packages/shared/ for shared types and constants - Update root package.json with new dev commands - Temporarily skip type-check (run pnpm install first) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
61 lines
1.8 KiB
TypeScript
61 lines
1.8 KiB
TypeScript
import React from 'react';
|
|
import { View, Text } from 'react-native';
|
|
import { Ionicons } from '@expo/vector-icons';
|
|
import { useTheme } from '../../utils/ThemeContext';
|
|
import SubscriptionButton from './SubscriptionButton';
|
|
|
|
export interface PackageProps {
|
|
id: string;
|
|
name: string;
|
|
manaAmount: number;
|
|
price: number;
|
|
isTeamPackage?: boolean;
|
|
popular?: boolean;
|
|
}
|
|
|
|
interface PackageCardProps {
|
|
package: PackageProps;
|
|
onSelect: (packageId: string) => void;
|
|
}
|
|
|
|
export const PackageCard: React.FC<PackageCardProps> = ({ package: pkg, onSelect }) => {
|
|
const { theme } = useTheme();
|
|
|
|
const formatPrice = (price: number) => {
|
|
return `${price.toFixed(2).replace('.', ',')}€`;
|
|
};
|
|
|
|
return (
|
|
<View
|
|
className={`bg-[rgba(255,255,255,${pkg.isTeamPackage ? '0.08' : '0.05'})] rounded-xl p-4 border ${pkg.isTeamPackage ? 'border-primary' : 'border-[rgba(255,255,255,0.1)]'}`}
|
|
style={pkg.isTeamPackage ? { borderColor: theme.colors.primary } : {}}
|
|
>
|
|
{pkg.isTeamPackage && (
|
|
<View
|
|
className="absolute top-[-10px] right-4 rounded-xl px-2.5 py-1"
|
|
style={{ backgroundColor: theme.colors.primary }}
|
|
>
|
|
<Text className="text-black text-xs font-bold">Team</Text>
|
|
</View>
|
|
)}
|
|
|
|
<Text className="text-white text-xl font-bold mb-2">{pkg.name}</Text>
|
|
<Text className="text-white text-2xl font-bold mb-1">{pkg.manaAmount} Mana</Text>
|
|
<Text className="text-white text-xl font-bold">{formatPrice(pkg.price)}</Text>
|
|
<Text className="text-[rgba(255,255,255,0.7)] text-sm mt-1 mb-4">
|
|
({formatPrice(pkg.price / pkg.manaAmount)} pro Mana)
|
|
</Text>
|
|
|
|
<View className="mt-4">
|
|
<SubscriptionButton
|
|
label="Auswählen"
|
|
onPress={() => onSelect(pkg.id)}
|
|
iconName="chevron-forward"
|
|
variant={pkg.popular ? 'accent' : 'primary'}
|
|
/>
|
|
</View>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
export default PackageCard;
|