chahinebrini 3c52d8869e feat(native): WIP checkpoint — Profile/Settings/Demographics + WheelPicker + Maestro
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>
2026-05-08 19:32:27 +02:00

134 lines
3.7 KiB
TypeScript

import { useState } from 'react';
import { View, Text, Pressable, LayoutAnimation, Platform, UIManager } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { colors } from '../../lib/theme';
if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
export type ApprovedDomain = {
domain: string;
approvedAt: string;
};
type Props = {
domains: ApprovedDomain[];
loading?: boolean;
};
export function ApprovedDomainsList({ domains, loading }: Props) {
const [expanded, setExpanded] = useState(false);
function toggle() {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
setExpanded((v) => !v);
}
return (
<View style={{ marginHorizontal: 16, marginTop: 12 }}>
<Pressable
onPress={toggle}
style={({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })}
>
<View
style={{
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
backgroundColor: '#ffffff',
borderWidth: 1,
borderColor: '#e5e5e5',
borderRadius: 14,
padding: 16,
}}
>
<View style={{ flex: 1 }}>
<Text style={{ fontSize: 13, color: colors.text, fontFamily: 'Nunito_600SemiBold' }}>
Approved Domains{' '}
<Text style={{ color: colors.textMuted, fontFamily: 'Nunito_400Regular' }}>
({domains.length})
</Text>
</Text>
</View>
<Ionicons
name={expanded ? 'chevron-up' : 'chevron-down'}
size={18}
color={colors.textMuted}
/>
</View>
</Pressable>
{expanded ? (
<View
style={{
marginTop: 6,
backgroundColor: '#ffffff',
borderWidth: 1,
borderColor: '#e5e5e5',
borderRadius: 12,
paddingVertical: 4,
}}
>
{loading ? (
<View style={{ padding: 16 }}>
<SkeletonRow />
<SkeletonRow />
<SkeletonRow />
</View>
) : domains.length === 0 ? (
<Text
style={{
paddingVertical: 16,
paddingHorizontal: 14,
fontSize: 12,
color: colors.textMuted,
fontFamily: 'Nunito_400Regular',
}}
>
Noch keine approved Domains. Submit deine erste in der Community.
</Text>
) : (
domains.map((d, idx) => (
<View
key={d.domain}
style={{
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingVertical: 10,
paddingHorizontal: 14,
borderTopWidth: idx === 0 ? 0 : 1,
borderTopColor: 'rgba(0,0,0,0.06)',
}}
>
<Text style={{ fontSize: 13, color: colors.text, fontFamily: 'Nunito_600SemiBold' }}>
{d.domain}
</Text>
<Text
style={{ fontSize: 11, color: colors.textMuted, fontFamily: 'Nunito_400Regular' }}
>
{d.approvedAt}
</Text>
</View>
))
)}
</View>
) : null}
</View>
);
}
function SkeletonRow() {
return (
<View
style={{
height: 14,
backgroundColor: '#f5f5f5',
borderRadius: 4,
marginVertical: 6,
}}
/>
);
}