Add desktop (Electron) and mobile (Expo) showcase apps
New workspace packages for demonstrating design system components: - Desktop: Electron + Vite app with brand/theme switching - Mobile: Expo React Native app with brand switching Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
67
packages/showcase/mobile/src/navigation/RootNavigator.tsx
Normal file
67
packages/showcase/mobile/src/navigation/RootNavigator.tsx
Normal file
@@ -0,0 +1,67 @@
|
||||
import React from 'react';
|
||||
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
||||
import { useDTTheme } from '@dangerousthings/react-native';
|
||||
import type { RootStackParamList } from './types';
|
||||
|
||||
import { HomeScreen } from '../screens/HomeScreen';
|
||||
import { ButtonsScreen } from '../screens/ButtonsScreen';
|
||||
import { CardsScreen } from '../screens/CardsScreen';
|
||||
import { FormsScreen } from '../screens/FormsScreen';
|
||||
import { FeedbackScreen } from '../screens/FeedbackScreen';
|
||||
import { OverlaysScreen } from '../screens/OverlaysScreen';
|
||||
import { ThemeScreen } from '../screens/ThemeScreen';
|
||||
|
||||
const Stack = createNativeStackNavigator<RootStackParamList>();
|
||||
|
||||
export function RootNavigator() {
|
||||
const theme = useDTTheme();
|
||||
|
||||
return (
|
||||
<Stack.Navigator
|
||||
initialRouteName="Home"
|
||||
screenOptions={{
|
||||
headerStyle: { backgroundColor: theme.colors.background },
|
||||
headerTintColor: theme.custom.modeNormal,
|
||||
headerTitleStyle: { fontWeight: '600' },
|
||||
contentStyle: { backgroundColor: theme.colors.background },
|
||||
animation: 'slide_from_right',
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="Home"
|
||||
component={HomeScreen}
|
||||
options={{ headerShown: false }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Buttons"
|
||||
component={ButtonsScreen}
|
||||
options={{ title: 'BUTTONS & ACTIONS' }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Cards"
|
||||
component={CardsScreen}
|
||||
options={{ title: 'CARDS & LABELS' }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Forms"
|
||||
component={FormsScreen}
|
||||
options={{ title: 'FORM CONTROLS' }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Feedback"
|
||||
component={FeedbackScreen}
|
||||
options={{ title: 'PROGRESS & FEEDBACK' }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Overlays"
|
||||
component={OverlaysScreen}
|
||||
options={{ title: 'OVERLAYS & NAV' }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Theme"
|
||||
component={ThemeScreen}
|
||||
options={{ title: 'THEME REFERENCE' }}
|
||||
/>
|
||||
</Stack.Navigator>
|
||||
);
|
||||
}
|
||||
21
packages/showcase/mobile/src/navigation/navigationTheme.ts
Normal file
21
packages/showcase/mobile/src/navigation/navigationTheme.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { DefaultTheme } from '@react-navigation/native';
|
||||
import { useBrand } from '../brand/BrandContext';
|
||||
|
||||
export function useNavigationTheme() {
|
||||
const { brand } = useBrand();
|
||||
const colors = brand.dark;
|
||||
|
||||
return {
|
||||
...DefaultTheme,
|
||||
dark: true,
|
||||
colors: {
|
||||
...DefaultTheme.colors,
|
||||
primary: colors.primary,
|
||||
background: colors.bg,
|
||||
card: colors.bg,
|
||||
text: colors.textPrimary,
|
||||
border: colors.primary,
|
||||
notification: colors.secondary,
|
||||
},
|
||||
};
|
||||
}
|
||||
9
packages/showcase/mobile/src/navigation/types.ts
Normal file
9
packages/showcase/mobile/src/navigation/types.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export type RootStackParamList = {
|
||||
Home: undefined;
|
||||
Buttons: undefined;
|
||||
Cards: undefined;
|
||||
Forms: undefined;
|
||||
Feedback: undefined;
|
||||
Overlays: undefined;
|
||||
Theme: undefined;
|
||||
};
|
||||
Reference in New Issue
Block a user