create-expo-stack 2.12.2 → 2.12.3-next.23deeea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/templates/base/App.tsx.ejs +4 -1
- package/build/templates/base/app.json.ejs +5 -2
- package/build/templates/base/babel.config.js.ejs +11 -1
- package/build/templates/base/package.json.ejs +23 -18
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +13 -1
- package/build/templates/packages/expo-router/drawer/app/(drawer)/_layout.tsx.ejs +57 -27
- package/build/templates/packages/expo-router/drawer/app/+html.tsx.ejs +6 -3
- package/build/templates/packages/expo-router/drawer/app/+not-found.tsx.ejs +4 -5
- package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +30 -5
- package/build/templates/packages/expo-router/index.js.ejs +4 -0
- package/build/templates/packages/expo-router/stack/app/+html.tsx.ejs +6 -3
- package/build/templates/packages/expo-router/stack/app/+not-found.tsx.ejs +8 -11
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +19 -3
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +18 -2
- package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +20 -3
- package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +19 -4
- package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +19 -4
- package/build/templates/packages/expo-router/tabs/app/+html.tsx.ejs +6 -3
- package/build/templates/packages/expo-router/tabs/app/+not-found.tsx.ejs +3 -7
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +21 -5
- package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +28 -0
- package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +67 -10
- package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +21 -3
- package/build/templates/packages/react-navigation/screens/details.tsx.ejs +20 -4
- package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +20 -5
- package/build/templates/packages/unistyles/components/BackButton.tsx.ejs +22 -20
- package/build/templates/packages/unistyles/components/Button.tsx.ejs +31 -9
- package/build/templates/packages/unistyles/components/Container.tsx.ejs +13 -5
- package/build/templates/packages/unistyles/components/EditScreenInfo.tsx.ejs +52 -49
- package/build/templates/packages/unistyles/components/ScreenContent.tsx.ejs +33 -15
- package/build/templates/packages/unistyles/theme.ts.ejs +29 -56
- package/build/templates/packages/unistyles/unistyles.ts.ejs +17 -17
- package/build/types/utilities/systemCommand.d.ts +3 -2
- package/build/utilities/configureProjectFiles.js +2 -1
- package/build/utilities/printOutput.js +24 -2
- package/build/utilities/systemCommand.js +6 -3
- package/package.json +72 -72
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Stack } from 'expo-router';
|
|
2
|
+
<% if (props.stylingPackage?.name === 'unistyles') { %>
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
5
|
+
<% } else { %>
|
|
2
6
|
import { StyleSheet, View } from 'react-native';
|
|
7
|
+
<% } %>
|
|
3
8
|
|
|
4
9
|
import { ScreenContent } from '~/components/ScreenContent';
|
|
5
10
|
|
|
@@ -14,9 +19,19 @@ export default function Home() {
|
|
|
14
19
|
);
|
|
15
20
|
}
|
|
16
21
|
|
|
22
|
+
<% if (props.stylingPackage?.name === 'unistyles') { %>
|
|
23
|
+
const styles = StyleSheet.create(theme => ({
|
|
24
|
+
container: {
|
|
25
|
+
flex: 1,
|
|
26
|
+
padding: 24,
|
|
27
|
+
backgroundColor: theme.colors.background,
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
30
|
+
<% } else { %>
|
|
17
31
|
const styles = StyleSheet.create({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
32
|
+
container: {
|
|
33
|
+
flex: 1,
|
|
34
|
+
padding: 24,
|
|
35
|
+
},
|
|
22
36
|
});
|
|
37
|
+
<% } %>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Stack } from 'expo-router';
|
|
2
|
+
<% if (props.stylingPackage?.name === 'unistyles') { %>
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
5
|
+
<% } else { %>
|
|
2
6
|
import { StyleSheet, View } from 'react-native';
|
|
7
|
+
<% } %>
|
|
3
8
|
|
|
4
9
|
import { ScreenContent } from '~/components/ScreenContent';
|
|
5
10
|
|
|
@@ -14,9 +19,19 @@ export default function Home() {
|
|
|
14
19
|
);
|
|
15
20
|
}
|
|
16
21
|
|
|
22
|
+
<% if (props.stylingPackage?.name === 'unistyles') { %>
|
|
23
|
+
const styles = StyleSheet.create(theme => ({
|
|
24
|
+
container: {
|
|
25
|
+
flex: 1,
|
|
26
|
+
padding: 24,
|
|
27
|
+
backgroundColor: theme.colors.background,
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
30
|
+
<% } else { %>
|
|
17
31
|
const styles = StyleSheet.create({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
32
|
+
container: {
|
|
33
|
+
flex: 1,
|
|
34
|
+
padding: 24,
|
|
35
|
+
},
|
|
22
36
|
});
|
|
37
|
+
<% } %>
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ScrollViewStyleReset } from 'expo-router/html';
|
|
2
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
3
|
+
import '../unistyles';
|
|
4
|
+
<% } %>
|
|
2
5
|
|
|
3
6
|
// This file is web-only and used to configure the root HTML for every
|
|
4
7
|
// web page during static rendering.
|
|
@@ -11,7 +14,7 @@ export default function Root({ children }: { children: React.ReactNode }) {
|
|
|
11
14
|
<meta charSet="utf-8" />
|
|
12
15
|
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
|
|
13
16
|
|
|
14
|
-
{/*
|
|
17
|
+
{/*
|
|
15
18
|
This viewport disables scaling which makes the mobile website act more like a native app.
|
|
16
19
|
However this does reduce built-in accessibility. If you want to enable scaling, use this instead:
|
|
17
20
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
@@ -20,8 +23,8 @@ export default function Root({ children }: { children: React.ReactNode }) {
|
|
|
20
23
|
name="viewport"
|
|
21
24
|
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1.00001,viewport-fit=cover"
|
|
22
25
|
/>
|
|
23
|
-
{/*
|
|
24
|
-
Disable body scrolling on web. This makes ScrollView components work closer to how they do on native.
|
|
26
|
+
{/*
|
|
27
|
+
Disable body scrolling on web. This makes ScrollView components work closer to how they do on native.
|
|
25
28
|
However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line.
|
|
26
29
|
*/}
|
|
27
30
|
<ScrollViewStyleReset />
|
|
@@ -2,7 +2,7 @@ import { Link, Stack } from 'expo-router';
|
|
|
2
2
|
<% if (props.stylingPackage?.name === "nativewind") {%>
|
|
3
3
|
import { Text, View } from 'react-native';
|
|
4
4
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
5
|
-
import {
|
|
5
|
+
import { StyleSheet } from 'react-native-unistyles'
|
|
6
6
|
import { Text, View } from 'react-native';
|
|
7
7
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
8
8
|
import { StyleSheet, Text, View } from 'react-native';
|
|
@@ -18,10 +18,6 @@ export default function NotFoundScreen() {
|
|
|
18
18
|
const styles = useStyles();
|
|
19
19
|
<% } %>
|
|
20
20
|
|
|
21
|
-
<% if (props.stylingPackage?.name === "unistyles") {%>
|
|
22
|
-
const { styles } = useStyles(stylesheet);
|
|
23
|
-
<% } %>
|
|
24
|
-
|
|
25
21
|
return (
|
|
26
22
|
<% if (props.stylingPackage?.name === "nativewind") {%>
|
|
27
23
|
<>
|
|
@@ -79,7 +75,7 @@ export default function NotFoundScreen() {
|
|
|
79
75
|
linkText: `text-base text-[#2e78b7]`,
|
|
80
76
|
};
|
|
81
77
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
82
|
-
const
|
|
78
|
+
const styles = StyleSheet.create((theme) => ({
|
|
83
79
|
container: {
|
|
84
80
|
flex: 1,
|
|
85
81
|
alignItems: 'center',
|
|
@@ -127,4 +123,4 @@ export default function NotFoundScreen() {
|
|
|
127
123
|
paddingVertical: theme.spacing.m_16,
|
|
128
124
|
},
|
|
129
125
|
}));
|
|
130
|
-
<% } %>
|
|
126
|
+
<% } %>
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
<% } else if (props.stylingPackage?.name === "nativewinui") { %>
|
|
4
4
|
import '../global.css';
|
|
5
5
|
import 'expo-dev-client';
|
|
6
|
-
<% } %>
|
|
7
|
-
|
|
8
|
-
import '../unistyles';
|
|
6
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
7
|
+
import { useUnistyles } from "react-native-unistyles";
|
|
9
8
|
<% } %>
|
|
10
9
|
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
11
10
|
import '../translation';
|
|
@@ -54,6 +53,9 @@ export default function RootLayout() {
|
|
|
54
53
|
|
|
55
54
|
if (!loaded) return null;
|
|
56
55
|
<% } %>
|
|
56
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
57
|
+
const { theme } = useUnistyles();
|
|
58
|
+
<% } %>
|
|
57
59
|
|
|
58
60
|
return (
|
|
59
61
|
<% if (props.stylingPackage?.name === "tamagui") { %>
|
|
@@ -61,7 +63,21 @@ export default function RootLayout() {
|
|
|
61
63
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
62
64
|
<ThemeProvider theme={theme}>
|
|
63
65
|
<% } %>
|
|
64
|
-
|
|
66
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
67
|
+
<Stack
|
|
68
|
+
screenOptions={{
|
|
69
|
+
headerStyle: {
|
|
70
|
+
backgroundColor: theme.colors.background,
|
|
71
|
+
},
|
|
72
|
+
headerTitleStyle: {
|
|
73
|
+
color: theme.colors.typography,
|
|
74
|
+
},
|
|
75
|
+
headerTintColor: theme.colors.typography
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
<% } else { %>
|
|
79
|
+
<Stack>
|
|
80
|
+
<% } %>
|
|
65
81
|
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
66
82
|
<Stack.Screen name="modal" options={{ presentation: "modal" }} />
|
|
67
83
|
</Stack>
|
|
@@ -71,4 +87,4 @@ export default function RootLayout() {
|
|
|
71
87
|
</ThemeProvider>
|
|
72
88
|
<% } %>
|
|
73
89
|
);
|
|
74
|
-
}
|
|
90
|
+
}
|
|
@@ -2,6 +2,9 @@ import { Ionicons, MaterialIcons } from '@expo/vector-icons';
|
|
|
2
2
|
import { createDrawerNavigator } from '@react-navigation/drawer';
|
|
3
3
|
import { StackScreenProps } from '@react-navigation/stack';
|
|
4
4
|
import { HeaderButton } from 'components/HeaderButton';
|
|
5
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
6
|
+
import { useUnistyles } from 'react-native-unistyles';
|
|
7
|
+
<% } %>
|
|
5
8
|
|
|
6
9
|
import { RootStackParamList } from '.';
|
|
7
10
|
import TabNavigator from './tab-navigator';
|
|
@@ -12,8 +15,33 @@ type Props = StackScreenProps<RootStackParamList, 'DrawerNavigator'>;
|
|
|
12
15
|
const Drawer = createDrawerNavigator();
|
|
13
16
|
|
|
14
17
|
export default function DrawerNavigator({ navigation }: Props) {
|
|
18
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
19
|
+
const { theme } = useUnistyles();
|
|
20
|
+
<% } %>
|
|
21
|
+
|
|
15
22
|
return (
|
|
23
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
24
|
+
<Drawer.Navigator
|
|
25
|
+
screenOptions={{
|
|
26
|
+
headerStyle: {
|
|
27
|
+
backgroundColor: theme.colors.background,
|
|
28
|
+
},
|
|
29
|
+
headerTitleStyle: {
|
|
30
|
+
color: theme.colors.typography,
|
|
31
|
+
},
|
|
32
|
+
headerTintColor: theme.colors.typography,
|
|
33
|
+
drawerStyle: {
|
|
34
|
+
backgroundColor: theme.colors.background,
|
|
35
|
+
},
|
|
36
|
+
drawerLabelStyle: {
|
|
37
|
+
color: theme.colors.typography,
|
|
38
|
+
},
|
|
39
|
+
drawerInactiveTintColor: theme.colors.typography,
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<% } else { %>
|
|
16
43
|
<Drawer.Navigator>
|
|
44
|
+
<% } %>
|
|
17
45
|
<Drawer.Screen
|
|
18
46
|
name="Home"
|
|
19
47
|
component={Home}
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
import { NavigationContainer } from "@react-navigation/native";
|
|
3
3
|
import { createStackNavigator } from "@react-navigation/stack";
|
|
4
4
|
|
|
5
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
6
|
+
import { useUnistyles } from 'react-native-unistyles';
|
|
7
|
+
<% } %>
|
|
8
|
+
|
|
5
9
|
import Overview from "../screens/overview";
|
|
6
10
|
import Details from "../screens/details";
|
|
7
|
-
|
|
11
|
+
import { BackButton } from '../components/BackButton';
|
|
8
12
|
|
|
9
13
|
export type RootStackParamList = {
|
|
10
14
|
Overview: undefined;
|
|
@@ -14,10 +18,25 @@
|
|
|
14
18
|
const Stack = createStackNavigator<RootStackParamList>();
|
|
15
19
|
|
|
16
20
|
export default function RootStack() {
|
|
17
|
-
|
|
21
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
22
|
+
const { theme } = useUnistyles();
|
|
23
|
+
<% } %>
|
|
18
24
|
return (
|
|
19
25
|
<NavigationContainer>
|
|
20
|
-
<Stack.Navigator
|
|
26
|
+
<Stack.Navigator
|
|
27
|
+
initialRouteName="Overview"
|
|
28
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
29
|
+
screenOptions={{
|
|
30
|
+
headerStyle: {
|
|
31
|
+
backgroundColor: theme.colors.background,
|
|
32
|
+
},
|
|
33
|
+
headerTitleStyle: {
|
|
34
|
+
color: theme.colors.typography,
|
|
35
|
+
},
|
|
36
|
+
headerTintColor: theme.colors.typography,
|
|
37
|
+
}}
|
|
38
|
+
<% } %>
|
|
39
|
+
>
|
|
21
40
|
<Stack.Screen name="Overview" component={Overview} />
|
|
22
41
|
<Stack.Screen
|
|
23
42
|
name="Details"
|
|
@@ -34,6 +53,9 @@
|
|
|
34
53
|
<% } else if (props.navigationPackage?.options.type === 'tabs') { %>
|
|
35
54
|
import { NavigationContainer } from "@react-navigation/native";
|
|
36
55
|
import { createStackNavigator } from "@react-navigation/stack";
|
|
56
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
57
|
+
import { useUnistyles } from 'react-native-unistyles';
|
|
58
|
+
<% } %>
|
|
37
59
|
|
|
38
60
|
import Modal from "../screens/modal";
|
|
39
61
|
import TabNavigator from "./tab-navigator";
|
|
@@ -46,9 +68,25 @@
|
|
|
46
68
|
const Stack = createStackNavigator<RootStackParamList>();
|
|
47
69
|
|
|
48
70
|
export default function RootStack() {
|
|
71
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
72
|
+
const { theme } = useUnistyles();
|
|
73
|
+
<% } %>
|
|
49
74
|
return (
|
|
50
75
|
<NavigationContainer>
|
|
51
|
-
<Stack.Navigator
|
|
76
|
+
<Stack.Navigator
|
|
77
|
+
initialRouteName="TabNavigator"
|
|
78
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
79
|
+
screenOptions={{
|
|
80
|
+
headerStyle: {
|
|
81
|
+
backgroundColor: theme.colors.background,
|
|
82
|
+
},
|
|
83
|
+
headerTitleStyle: {
|
|
84
|
+
color: theme.colors.typography,
|
|
85
|
+
},
|
|
86
|
+
headerTintColor: theme.colors.typography,
|
|
87
|
+
}}
|
|
88
|
+
<% } %>
|
|
89
|
+
>
|
|
52
90
|
<Stack.Screen
|
|
53
91
|
name="TabNavigator"
|
|
54
92
|
component={TabNavigator}
|
|
@@ -66,22 +104,41 @@
|
|
|
66
104
|
<% } else if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
|
|
67
105
|
import { NavigationContainer } from "@react-navigation/native";
|
|
68
106
|
import { createStackNavigator } from '@react-navigation/stack';
|
|
69
|
-
|
|
107
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
108
|
+
import { useUnistyles } from 'react-native-unistyles';
|
|
109
|
+
<% } %>
|
|
110
|
+
|
|
70
111
|
import Modal from "../screens/modal";
|
|
71
112
|
import DrawerNavigator from "./drawer-navigator";
|
|
72
|
-
|
|
113
|
+
|
|
73
114
|
export type RootStackParamList = {
|
|
74
115
|
DrawerNavigator: undefined;
|
|
75
116
|
Modal: undefined;
|
|
76
117
|
TabNavigator: undefined;
|
|
77
118
|
};
|
|
78
|
-
|
|
119
|
+
|
|
79
120
|
const Stack = createStackNavigator<RootStackParamList>();
|
|
80
|
-
|
|
121
|
+
|
|
81
122
|
export default function RootStack() {
|
|
123
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
124
|
+
const { theme } = useUnistyles();
|
|
125
|
+
<% } %>
|
|
82
126
|
return (
|
|
83
127
|
<NavigationContainer>
|
|
84
|
-
<Stack.Navigator
|
|
128
|
+
<Stack.Navigator
|
|
129
|
+
initialRouteName="DrawerNavigator"
|
|
130
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
131
|
+
screenOptions={{
|
|
132
|
+
headerStyle: {
|
|
133
|
+
backgroundColor: theme.colors.background,
|
|
134
|
+
},
|
|
135
|
+
headerTitleStyle: {
|
|
136
|
+
color: theme.colors.typography,
|
|
137
|
+
},
|
|
138
|
+
headerTintColor: theme.colors.typography,
|
|
139
|
+
}}
|
|
140
|
+
<% } %>
|
|
141
|
+
>
|
|
85
142
|
<Stack.Screen
|
|
86
143
|
name="DrawerNavigator"
|
|
87
144
|
component={DrawerNavigator}
|
|
@@ -96,4 +153,4 @@
|
|
|
96
153
|
</NavigationContainer>
|
|
97
154
|
);
|
|
98
155
|
}
|
|
99
|
-
<% } %>
|
|
156
|
+
<% } %>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
|
2
2
|
import { StackScreenProps } from '@react-navigation/stack';
|
|
3
|
-
|
|
3
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
4
|
+
import { useUnistyles } from 'react-native-unistyles';
|
|
5
|
+
<% } %>
|
|
4
6
|
import { RootStackParamList } from '.';
|
|
5
7
|
import { HeaderButton } from '../components/HeaderButton';
|
|
6
8
|
import { TabBarIcon } from '../components/TabBarIcon';
|
|
@@ -12,10 +14,26 @@ const Tab = createBottomTabNavigator();
|
|
|
12
14
|
type Props = StackScreenProps<RootStackParamList, 'TabNavigator'>;
|
|
13
15
|
|
|
14
16
|
export default function TabLayout({ navigation }: Props) {
|
|
17
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
18
|
+
const { theme } = useUnistyles();
|
|
19
|
+
<% } %>
|
|
15
20
|
return (
|
|
16
21
|
<Tab.Navigator
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
screenOptions={{
|
|
23
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
24
|
+
headerStyle: {
|
|
25
|
+
backgroundColor: theme.colors.background,
|
|
26
|
+
},
|
|
27
|
+
headerTitleStyle: {
|
|
28
|
+
color: theme.colors.typography,
|
|
29
|
+
},
|
|
30
|
+
tabBarActiveTintColor: theme.colors.astral,
|
|
31
|
+
tabBarStyle: {
|
|
32
|
+
backgroundColor: theme.colors.background,
|
|
33
|
+
},
|
|
34
|
+
<% } else { %>
|
|
35
|
+
tabBarActiveTintColor: 'black',
|
|
36
|
+
<% } %>
|
|
19
37
|
<% if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
|
|
20
38
|
headerShown: false,
|
|
21
39
|
<% } %>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { RouteProp, useRoute } from '@react-navigation/native';
|
|
2
2
|
import { ScreenContent } from 'components/ScreenContent';
|
|
3
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
6
|
+
<% } else {%>
|
|
3
7
|
import { StyleSheet, View } from 'react-native';
|
|
8
|
+
<% } %>
|
|
4
9
|
|
|
5
10
|
import { RootStackParamList } from '../navigation';
|
|
6
11
|
|
|
@@ -19,9 +24,20 @@ export default function Details() {
|
|
|
19
24
|
);
|
|
20
25
|
}
|
|
21
26
|
|
|
27
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
28
|
+
export const styles = StyleSheet.create((theme, rt) => ({
|
|
29
|
+
container: {
|
|
30
|
+
flex: 1,
|
|
31
|
+
padding: 24,
|
|
32
|
+
backgroundColor: theme.colors.background,
|
|
33
|
+
paddingBottom: rt.insets.bottom,
|
|
34
|
+
},
|
|
35
|
+
}));
|
|
36
|
+
<% } else { %>
|
|
22
37
|
export const styles = StyleSheet.create({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
container: {
|
|
39
|
+
flex: 1,
|
|
40
|
+
padding: 24,
|
|
41
|
+
},
|
|
27
42
|
});
|
|
43
|
+
<% } %>
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { useNavigation } from '@react-navigation/native';
|
|
2
2
|
import { StackNavigationProp } from '@react-navigation/stack';
|
|
3
3
|
import { ScreenContent } from 'components/ScreenContent';
|
|
4
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
5
|
+
import { View } from 'react-native';
|
|
6
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
7
|
+
<% } else {%>
|
|
4
8
|
import { StyleSheet, View } from 'react-native';
|
|
9
|
+
<% } %>
|
|
5
10
|
|
|
6
11
|
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
7
12
|
import { InternalizationExample } from 'components/InternalizationExample';
|
|
@@ -34,10 +39,20 @@ export default function Overview() {
|
|
|
34
39
|
);
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
43
|
+
export const styles = StyleSheet.create((theme, rt) => ({
|
|
44
|
+
container: {
|
|
45
|
+
flex: 1,
|
|
46
|
+
padding: 24,
|
|
47
|
+
backgroundColor: theme.colors.background,
|
|
48
|
+
paddingBottom: rt.insets.bottom,
|
|
49
|
+
},
|
|
50
|
+
}));
|
|
51
|
+
<% } else { %>
|
|
38
52
|
export const styles = StyleSheet.create({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
container: {
|
|
54
|
+
flex: 1,
|
|
55
|
+
padding: 24,
|
|
56
|
+
},
|
|
43
57
|
});
|
|
58
|
+
<% } %>
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { Feather } from '@expo/vector-icons';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { StyleSheet, withUnistyles } from 'react-native-unistyles';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const UniFeather = withUnistyles(Feather, theme => ({
|
|
6
|
+
color: theme.colors.azureRadiance
|
|
7
|
+
}));
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
export const BackButton = ({ onPress }: { onPress: () => void; }) => {
|
|
10
|
+
return (
|
|
11
|
+
<View style={styles.backButton}>
|
|
12
|
+
<UniFeather name="chevron-left" size={16} />
|
|
13
|
+
<Text style={styles.backButtonText} onPress={onPress}>
|
|
14
|
+
Back
|
|
15
|
+
</Text>
|
|
16
|
+
</View>
|
|
17
|
+
);
|
|
16
18
|
};
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const styles = StyleSheet.create((theme) => ({
|
|
20
|
+
backButton: {
|
|
21
|
+
flexDirection: 'row',
|
|
22
|
+
paddingLeft: 20,
|
|
23
|
+
},
|
|
24
|
+
backButtonText: {
|
|
25
|
+
color: theme.colors.azureRadiance,
|
|
26
|
+
marginLeft: 4,
|
|
27
|
+
},
|
|
26
28
|
}));
|
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import { Text, TouchableOpacity, TouchableOpacityProps, View } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
|
|
5
5
|
type ButtonProps = {
|
|
6
|
-
|
|
6
|
+
title?: string;
|
|
7
7
|
} & TouchableOpacityProps;
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
export const Button = forwardRef<View, ButtonProps>(({ title, ...touchableProps }, ref) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<TouchableOpacity ref={ref} {...touchableProps} style={[theme.components.button, touchableProps.style]}>
|
|
15
|
-
<Text style={theme.components.buttonText}>{title}</Text>
|
|
10
|
+
return (
|
|
11
|
+
<TouchableOpacity ref={ref} {...touchableProps} style={[styles.button, touchableProps.style]}>
|
|
12
|
+
<Text style={styles.buttonText}>{title}</Text>
|
|
16
13
|
</TouchableOpacity>
|
|
17
|
-
|
|
14
|
+
);
|
|
18
15
|
});
|
|
16
|
+
|
|
17
|
+
const styles = StyleSheet.create(theme => ({
|
|
18
|
+
button: {
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
backgroundColor: theme.colors.cornflowerBlue,
|
|
21
|
+
borderRadius: 24,
|
|
22
|
+
elevation: 5,
|
|
23
|
+
flexDirection: 'row',
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
padding: 16,
|
|
26
|
+
shadowColor: '#000',
|
|
27
|
+
shadowOffset: {
|
|
28
|
+
height: 2,
|
|
29
|
+
width: 0,
|
|
30
|
+
},
|
|
31
|
+
shadowOpacity: 0.25,
|
|
32
|
+
shadowRadius: 3.84,
|
|
33
|
+
},
|
|
34
|
+
buttonText: {
|
|
35
|
+
color: theme.colors.background,
|
|
36
|
+
fontSize: 16,
|
|
37
|
+
fontWeight: '600',
|
|
38
|
+
textAlign: 'center',
|
|
39
|
+
},
|
|
40
|
+
}));
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
3
4
|
|
|
4
5
|
export const Container = ({ children }: { children: React.ReactNode }) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
return (
|
|
7
|
+
<View style={styles.container}>{children}</View>
|
|
8
|
+
);
|
|
8
9
|
};
|
|
9
10
|
|
|
11
|
+
const styles = StyleSheet.create((theme, rt) => ({
|
|
12
|
+
container: {
|
|
13
|
+
flex: 1,
|
|
14
|
+
paddingBottom: rt.insets.bottom,
|
|
15
|
+
backgroundColor: theme.colors.background,
|
|
16
|
+
},
|
|
17
|
+
}));
|