import React from 'react'; import { View, StyleSheet } from 'react-native'; import { Text } from 'react-native-paper'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import type { NativeStackNavigationProp } from '@react-navigation/native-stack'; import { DTCard, DTHexagon, useDTTheme } from '@dangerousthings/react-native'; import type { DTVariant } from '@dangerousthings/react-native'; import type { RootStackParamList } from '../navigation/types'; import { ScreenContainer } from '../components/ScreenContainer'; import { BrandSwitcher } from '../components/BrandSwitcher'; import { useBrand } from '../brand/BrandContext'; type HomeScreenProps = { navigation: NativeStackNavigationProp; }; const categories: { title: string; subtitle: string; mode: DTVariant; route: keyof RootStackParamList; count: number; }[] = [ { title: 'BUTTONS & ACTIONS', subtitle: 'DTButton, DTChip, DTHexagon', mode: 'normal', route: 'Buttons', count: 3, }, { title: 'CARDS & LABELS', subtitle: 'DTCard, DTLabel, DTMediaFrame', mode: 'emphasis', route: 'Cards', count: 3, }, { title: 'FORM CONTROLS', subtitle: 'DTTextInput, DTCheckbox, DTSwitch, DTRadioGroup, DTQuantityStepper', mode: 'success', route: 'Forms', count: 5, }, { title: 'PROGRESS & FEEDBACK', subtitle: 'DTProgressBar, DTSearchInput', mode: 'other', route: 'Feedback', count: 2, }, { title: 'OVERLAYS & NAVIGATION', subtitle: 'DTModal, DTDrawer, DTAccordion, DTMenu, DTGallery', mode: 'warning', route: 'Overlays', count: 5, }, { title: 'ADVANCED CARDS', subtitle: 'Selected state, progress bar, badge overlays', mode: 'emphasis', route: 'CardsAdvanced', count: 4, }, { title: 'ANIMATIONS', subtitle: 'useScaleIn, usePulse', mode: 'success', route: 'Animations', count: 3, }, { title: 'FILTERS & FEATURES', subtitle: 'DTFeatureLegend, DTMobileFilterOverlay', mode: 'other', route: 'Filters', count: 2, }, { title: 'THEME REFERENCE', subtitle: 'Colors, Typography, Spacing', mode: 'normal', route: 'Theme', count: 0, }, ]; export function HomeScreen({ navigation }: HomeScreenProps) { const insets = useSafeAreaInsets(); const theme = useDTTheme(); const { brand } = useBrand(); return ( DANGEROUS THINGS DESIGN SYSTEM {brand.name} theme COMPONENT CATALOG {categories.map((cat) => ( navigation.navigate(cat.route)} style={styles.card} > {cat.subtitle} {cat.count > 0 && ( {cat.count} components )} ))} ); } const styles = StyleSheet.create({ header: { alignItems: 'center', marginBottom: 8, }, title: { letterSpacing: 2, }, subtitle: { letterSpacing: 3, marginTop: 4, }, version: { color: 'rgba(255,255,255,0.4)', marginTop: 8, }, hexRow: { flexDirection: 'row', justifyContent: 'center', gap: 10, marginVertical: 24, }, sectionLabel: { color: 'rgba(255,255,255,0.5)', letterSpacing: 2, marginBottom: 16, }, card: { marginBottom: 16, }, cardSubtitle: { color: 'rgba(255,255,255,0.7)', }, cardCount: { color: 'rgba(255,255,255,0.4)', marginTop: 8, }, });