import React, { useState } from 'react';
import {
View,
Text,
StyleSheet,
ScrollView,
TouchableOpacity,
Alert,
} from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { SafeAreaView } from 'react-native-safe-area-context';
import { router } from 'expo-router';
import { AppColors, BorderRadius, FontSizes, Spacing } from '@/constants/theme';
import { PageHeader } from '@/components/PageHeader';
interface PlanFeatureProps {
text: string;
included: boolean;
}
function PlanFeature({ text, included }: PlanFeatureProps) {
return (
{text}
);
}
export default function SubscriptionScreen() {
const [selectedPlan, setSelectedPlan] = useState<'monthly' | 'yearly'>('yearly');
const currentPlan = 'free'; // Could be 'free', 'pro', 'enterprise'
const handleSubscribe = () => {
Alert.alert(
'Subscribe to Pro',
`You selected the ${selectedPlan === 'yearly' ? 'Yearly' : 'Monthly'} plan.\n\n` +
`Total: ${selectedPlan === 'yearly' ? '$79.99/year (Save $39.89!)' : '$9.99/month'}`,
[
{ text: 'Cancel', style: 'cancel' },
{
text: 'Continue to Payment',
onPress: () => Alert.alert('Coming Soon', 'Payment integration coming soon!')
},
]
);
};
const handleRestorePurchases = () => {
Alert.alert(
'Restoring Purchases',
'Looking for previous purchases...',
[{ text: 'OK' }]
);
setTimeout(() => {
Alert.alert('No Purchases Found', 'We couldn\'t find any previous purchases associated with your account.');
}, 1500);
};
return (
{/* Current Plan Badge */}
CURRENT PLAN
Free
Basic monitoring features
{/* Pro Features */}
PRO
WellNuo Pro
Everything you need for complete care
{/* Pricing Options */}
Choose Your Plan
setSelectedPlan('yearly')}
>
Yearly
SAVE 33%
$79.99/year
$6.67/month
{selectedPlan === 'yearly' && (
)}
setSelectedPlan('monthly')}
>
Monthly
$9.99/month
Billed monthly
{selectedPlan === 'monthly' && (
)}
{/* Compare Plans */}
Compare Plans
Feature
Free
Pro
{[
{ feature: 'Beneficiaries', free: '2', pro: 'Unlimited' },
{ feature: 'Real-time alerts', free: '✓', pro: '✓' },
{ feature: 'Activity history', free: '7 days', pro: '1 year' },
{ feature: 'AI insights', free: '—', pro: '✓' },
{ feature: 'Custom alerts', free: '—', pro: '✓' },
{ feature: 'Data export', free: '—', pro: '✓' },
{ feature: 'Support', free: 'Email', pro: '24/7 Priority' },
].map((row, index) => (
{row.feature}
{row.free}
{row.pro}
))}
{/* Testimonials */}
What Users Say
{[
{
name: 'Sarah M.',
text: 'WellNuo Pro gives me peace of mind. The AI insights helped detect early warning signs.',
rating: 5,
},
{
name: 'John D.',
text: 'The family sharing feature is amazing. Now my siblings can all monitor our parents together.',
rating: 5,
},
{
name: 'Maria L.',
text: 'Worth every penny. The advanced analytics helped us understand mom\'s patterns better.',
rating: 5,
},
].map((testimonial, index) => (
{[...Array(testimonial.rating)].map((_, i) => (
))}
"{testimonial.text}"
— {testimonial.name}
))}
{/* Restore Purchases */}
Restore Purchases
{/* Terms */}
Payment will be charged to your Apple ID account at the confirmation of purchase.
Subscription automatically renews unless it is cancelled at least 24 hours before
the end of the current period.
{/* Subscribe Button */}
Subscribe to Pro — {selectedPlan === 'yearly' ? '$79.99/year' : '$9.99/month'}
7-day free trial • Cancel anytime
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: AppColors.surface,
},
currentPlanBanner: {
backgroundColor: AppColors.background,
padding: Spacing.lg,
alignItems: 'center',
},
currentPlanBadge: {
backgroundColor: '#E0E7FF',
paddingHorizontal: Spacing.sm,
paddingVertical: 4,
borderRadius: BorderRadius.sm,
},
currentPlanBadgeText: {
fontSize: FontSizes.xs,
fontWeight: '600',
color: '#4F46E5',
},
currentPlanName: {
fontSize: FontSizes.xl,
fontWeight: '700',
color: AppColors.textPrimary,
marginTop: Spacing.sm,
},
currentPlanDescription: {
fontSize: FontSizes.sm,
color: AppColors.textSecondary,
marginTop: 4,
},
section: {
marginTop: Spacing.md,
},
sectionTitle: {
fontSize: FontSizes.sm,
fontWeight: '600',
color: AppColors.textSecondary,
paddingHorizontal: Spacing.lg,
paddingVertical: Spacing.sm,
textTransform: 'uppercase',
},
proCard: {
backgroundColor: AppColors.background,
marginHorizontal: Spacing.lg,
borderRadius: BorderRadius.lg,
overflow: 'hidden',
borderWidth: 2,
borderColor: '#9333EA',
},
proHeader: {
backgroundColor: '#F3E8FF',
padding: Spacing.lg,
alignItems: 'center',
},
proBadge: {
flexDirection: 'row',
alignItems: 'center',
backgroundColor: AppColors.white,
paddingHorizontal: Spacing.md,
paddingVertical: Spacing.xs,
borderRadius: BorderRadius.full,
},
proBadgeText: {
fontSize: FontSizes.sm,
fontWeight: '700',
color: '#9333EA',
marginLeft: Spacing.xs,
},
proTitle: {
fontSize: FontSizes.xl,
fontWeight: '700',
color: '#9333EA',
marginTop: Spacing.md,
},
proSubtitle: {
fontSize: FontSizes.sm,
color: '#7C3AED',
marginTop: 4,
},
featuresContainer: {
padding: Spacing.lg,
},
featureRow: {
flexDirection: 'row',
alignItems: 'center',
paddingVertical: Spacing.xs,
},
featureText: {
fontSize: FontSizes.sm,
color: AppColors.textPrimary,
marginLeft: Spacing.sm,
},
featureTextDisabled: {
color: AppColors.textMuted,
},
planOption: {
flexDirection: 'row',
alignItems: 'center',
backgroundColor: AppColors.background,
marginHorizontal: Spacing.lg,
marginBottom: Spacing.sm,
padding: Spacing.md,
borderRadius: BorderRadius.lg,
borderWidth: 2,
borderColor: AppColors.border,
},
planOptionSelected: {
borderColor: AppColors.primary,
backgroundColor: '#DBEAFE',
},
planOptionContent: {
flex: 1,
},
planOptionHeader: {
flexDirection: 'row',
alignItems: 'center',
},
planOptionTitle: {
fontSize: FontSizes.lg,
fontWeight: '600',
color: AppColors.textPrimary,
},
saveBadge: {
backgroundColor: AppColors.success,
paddingHorizontal: Spacing.xs,
paddingVertical: 2,
borderRadius: BorderRadius.sm,
marginLeft: Spacing.sm,
},
saveBadgeText: {
fontSize: 10,
fontWeight: '700',
color: AppColors.white,
},
planOptionPrice: {
fontSize: FontSizes.xl,
fontWeight: '700',
color: AppColors.primary,
marginTop: 4,
},
planOptionSubprice: {
fontSize: FontSizes.xs,
color: AppColors.textMuted,
marginTop: 2,
},
radioButton: {
width: 24,
height: 24,
borderRadius: 12,
borderWidth: 2,
borderColor: AppColors.border,
justifyContent: 'center',
alignItems: 'center',
},
radioButtonSelected: {
borderColor: AppColors.primary,
},
radioButtonInner: {
width: 12,
height: 12,
borderRadius: 6,
backgroundColor: AppColors.primary,
},
comparisonCard: {
backgroundColor: AppColors.background,
marginHorizontal: Spacing.lg,
borderRadius: BorderRadius.lg,
overflow: 'hidden',
},
comparisonHeader: {
flexDirection: 'row',
backgroundColor: AppColors.surface,
paddingVertical: Spacing.sm,
paddingHorizontal: Spacing.md,
},
comparisonFeatureTitle: {
flex: 2,
fontSize: FontSizes.xs,
fontWeight: '600',
color: AppColors.textSecondary,
},
comparisonPlanTitle: {
flex: 1,
fontSize: FontSizes.xs,
fontWeight: '600',
color: AppColors.textSecondary,
textAlign: 'center',
},
comparisonRow: {
flexDirection: 'row',
paddingVertical: Spacing.sm,
paddingHorizontal: Spacing.md,
borderBottomWidth: 1,
borderBottomColor: AppColors.border,
},
comparisonFeature: {
flex: 2,
fontSize: FontSizes.sm,
color: AppColors.textPrimary,
},
comparisonValue: {
flex: 1,
fontSize: FontSizes.sm,
color: AppColors.textSecondary,
textAlign: 'center',
},
comparisonValuePro: {
color: '#9333EA',
fontWeight: '500',
},
testimonialCard: {
width: 280,
backgroundColor: AppColors.background,
marginLeft: Spacing.lg,
padding: Spacing.md,
borderRadius: BorderRadius.lg,
},
testimonialStars: {
flexDirection: 'row',
marginBottom: Spacing.sm,
},
testimonialText: {
fontSize: FontSizes.sm,
color: AppColors.textPrimary,
fontStyle: 'italic',
lineHeight: 20,
},
testimonialName: {
fontSize: FontSizes.xs,
color: AppColors.textMuted,
marginTop: Spacing.sm,
},
restoreButton: {
alignItems: 'center',
paddingVertical: Spacing.md,
marginTop: Spacing.md,
},
restoreButtonText: {
fontSize: FontSizes.sm,
color: AppColors.primary,
},
termsText: {
fontSize: FontSizes.xs,
color: AppColors.textMuted,
textAlign: 'center',
paddingHorizontal: Spacing.xl,
paddingBottom: Spacing.lg,
lineHeight: 16,
},
footer: {
padding: Spacing.lg,
backgroundColor: AppColors.background,
borderTopWidth: 1,
borderTopColor: AppColors.border,
},
subscribeButton: {
backgroundColor: '#9333EA',
borderRadius: BorderRadius.lg,
paddingVertical: Spacing.md,
alignItems: 'center',
},
subscribeButtonText: {
fontSize: FontSizes.base,
fontWeight: '600',
color: AppColors.white,
},
guaranteeText: {
fontSize: FontSizes.xs,
color: AppColors.textMuted,
textAlign: 'center',
marginTop: Spacing.sm,
},
});