Rollback-Punkt vor Expo SDK 54 / RN 0.81 Upgrade. UI/UX: - Profile: ProfileHeader redesign (sign-in chip + member-since), StatsBar 3 pill cards, Demographics accordion completed (Geburtsjahr, Geschlecht, Familienstand, Beruf-split, Wohnort), Pro-Trial-Banner, Approved-Domains list, DigaMissionBanner - Settings: section-based layout, neutral icons (matched Header dropdown style) - Header dropdown: extended with logout + games-page link - Notifications page: skeleton dummy data - Locales: i18n keys for new screens New components: - WheelPickerModal: native iOS UIPickerView wheel for long lists (Geburtsjahr 91 items, Bundesland 16, Stadt 30+/Bundesland) - OptionsBottomSheet: iOS-style options sheet (used briefly for Geschlecht, currently unused — kept for potential future use) - germanCities.ts: Top-cities per Bundesland (DSGVO-clean static data) New libs (NewArch-codegen verified): - @react-native-menu/menu 2.0.0 (UIMenu wrapper, Apple HIG-konform) - @lodev09/react-native-true-sheet 3.10.1 (UISheetPresentationController wrapper — ABER incompatible mit RN 0.79.6, Build-Error → Trigger für SDK-54-Upgrade) Maestro E2E: - Initial setup mit auth/community/profile/urge flows Scripts: - build-ios-clean.sh: Xcode DerivedData + ios/build cleanup vor expo run:ios Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
79 lines
2.0 KiB
TypeScript
79 lines
2.0 KiB
TypeScript
import { View, Text, Pressable, ActivityIndicator } from 'react-native';
|
|
import { Ionicons } from '@expo/vector-icons';
|
|
import { useState } from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
type Props = {
|
|
remainingFormatted: string; // "23:59:42"
|
|
onCancel: () => Promise<void>;
|
|
};
|
|
|
|
export function CooldownBanner({ remainingFormatted, onCancel }: Props) {
|
|
const { t } = useTranslation();
|
|
const [cancelling, setCancelling] = useState(false);
|
|
|
|
async function handleCancel() {
|
|
setCancelling(true);
|
|
try {
|
|
await onCancel();
|
|
} finally {
|
|
setCancelling(false);
|
|
}
|
|
}
|
|
|
|
return (
|
|
<View
|
|
style={{
|
|
backgroundColor: '#fef3c7',
|
|
borderWidth: 1,
|
|
borderColor: '#fcd34d',
|
|
borderRadius: 14,
|
|
padding: 12,
|
|
flexDirection: 'row',
|
|
alignItems: 'center',
|
|
gap: 12,
|
|
}}
|
|
>
|
|
<Ionicons name="time-outline" size={20} color="#d97706" />
|
|
<View style={{ flex: 1 }}>
|
|
<Text style={{ fontSize: 11, fontFamily: 'Nunito_400Regular', color: '#92400e' }}>
|
|
{t('blocker.cooldown_banner_title')}
|
|
</Text>
|
|
<Text
|
|
style={{
|
|
fontSize: 18,
|
|
fontFamily: 'Nunito_700Bold',
|
|
color: '#92400e',
|
|
fontVariant: ['tabular-nums'],
|
|
}}
|
|
>
|
|
{remainingFormatted}
|
|
</Text>
|
|
</View>
|
|
<Pressable
|
|
onPress={handleCancel}
|
|
disabled={cancelling}
|
|
hitSlop={8}
|
|
style={({ pressed }) => ({
|
|
opacity: pressed || cancelling ? 0.7 : 1,
|
|
})}
|
|
>
|
|
<View style={{
|
|
paddingHorizontal: 12,
|
|
paddingVertical: 8,
|
|
borderRadius: 12,
|
|
backgroundColor: '#16a34a',
|
|
}}>
|
|
{cancelling ? (
|
|
<ActivityIndicator size="small" color="#fff" />
|
|
) : (
|
|
<Text style={{ fontSize: 12, fontFamily: 'Nunito_600SemiBold', color: '#fff' }}>
|
|
{t('common.cancel')}
|
|
</Text>
|
|
)}
|
|
</View>
|
|
</Pressable>
|
|
</View>
|
|
);
|
|
}
|