@mr.dj2u/create-expo-stack 2.21.3-mrdj.0

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.
Files changed (191) hide show
  1. package/README.md +435 -0
  2. package/bin/create-expo-stack.js +2 -0
  3. package/build/cli.js +49 -0
  4. package/build/commands/create-expo-stack.js +471 -0
  5. package/build/constants.js +39 -0
  6. package/build/templates/base/.gitignore.ejs +26 -0
  7. package/build/templates/base/.npmrc.ejs +1 -0
  8. package/build/templates/base/App.tsx.ejs +66 -0
  9. package/build/templates/base/app.json.ejs +69 -0
  10. package/build/templates/base/assets/adaptive-icon.png +0 -0
  11. package/build/templates/base/assets/favicon.png +0 -0
  12. package/build/templates/base/assets/icon.png +0 -0
  13. package/build/templates/base/assets/splash.png +0 -0
  14. package/build/templates/base/babel.config.js.ejs +38 -0
  15. package/build/templates/base/components/BackButton.tsx.ejs +23 -0
  16. package/build/templates/base/components/Button.tsx.ejs +42 -0
  17. package/build/templates/base/components/Container.tsx.ejs +14 -0
  18. package/build/templates/base/components/EditScreenInfo.tsx.ejs +44 -0
  19. package/build/templates/base/components/HeaderButton.tsx.ejs +31 -0
  20. package/build/templates/base/components/ScreenContent.tsx.ejs +40 -0
  21. package/build/templates/base/components/TabBarIcon.tsx.ejs +15 -0
  22. package/build/templates/base/eslint.config.js.ejs +15 -0
  23. package/build/templates/base/package.json.ejs +191 -0
  24. package/build/templates/base/prettier.config.js.ejs +11 -0
  25. package/build/templates/base/tsconfig.json.ejs +39 -0
  26. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +40 -0
  27. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/index.tsx.ejs +15 -0
  28. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/two.tsx.ejs +15 -0
  29. package/build/templates/packages/expo-router/drawer/app/(drawer)/_layout.tsx.ejs +65 -0
  30. package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +15 -0
  31. package/build/templates/packages/expo-router/drawer/app/+html.tsx.ejs +49 -0
  32. package/build/templates/packages/expo-router/drawer/app/+not-found.tsx.ejs +100 -0
  33. package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +91 -0
  34. package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +21 -0
  35. package/build/templates/packages/expo-router/expo-env.d.ts +4 -0
  36. package/build/templates/packages/expo-router/index.js.ejs +4 -0
  37. package/build/templates/packages/expo-router/metro.config.js.ejs +24 -0
  38. package/build/templates/packages/expo-router/stack/app/+html.tsx.ejs +49 -0
  39. package/build/templates/packages/expo-router/stack/app/+not-found.tsx.ejs +113 -0
  40. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +63 -0
  41. package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +56 -0
  42. package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +73 -0
  43. package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +52 -0
  44. package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +37 -0
  45. package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +37 -0
  46. package/build/templates/packages/expo-router/tabs/app/+html.tsx.ejs +49 -0
  47. package/build/templates/packages/expo-router/tabs/app/+not-found.tsx.ejs +110 -0
  48. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +84 -0
  49. package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +21 -0
  50. package/build/templates/packages/firebase/.env.ejs +8 -0
  51. package/build/templates/packages/firebase/metro.config.js.ejs +14 -0
  52. package/build/templates/packages/firebase/utils/firebase.ts.ejs +26 -0
  53. package/build/templates/packages/i18next/components/InternalizationExample.tsx.ejs +23 -0
  54. package/build/templates/packages/i18next/core/i18n/fallbackChecker.ts.ejs +13 -0
  55. package/build/templates/packages/i18next/core/i18n/init.ts.ejs +24 -0
  56. package/build/templates/packages/i18next/core/i18n/languageDetector.ts.ejs +13 -0
  57. package/build/templates/packages/i18next/translation/en.json.ejs +8 -0
  58. package/build/templates/packages/i18next/translation/fr.json.ejs +8 -0
  59. package/build/templates/packages/i18next/translation/index.ts.ejs +20 -0
  60. package/build/templates/packages/nativewind/components/BackButton.tsx.ejs +22 -0
  61. package/build/templates/packages/nativewind/components/Button.tsx.ejs +21 -0
  62. package/build/templates/packages/nativewind/components/Container.tsx.ejs +13 -0
  63. package/build/templates/packages/nativewind/components/EditScreenInfo.tsx.ejs +40 -0
  64. package/build/templates/packages/nativewind/components/ScreenContent.tsx.ejs +27 -0
  65. package/build/templates/packages/nativewind/global.css +3 -0
  66. package/build/templates/packages/nativewind/metro.config.js +7 -0
  67. package/build/templates/packages/nativewind/nativewind-env.d.ts +2 -0
  68. package/build/templates/packages/nativewind/tailwind.config.js.ejs +15 -0
  69. package/build/templates/packages/nativewindui/components/Container.tsx.ejs +14 -0
  70. package/build/templates/packages/nativewindui/components/EditScreenInfo.tsx.ejs +45 -0
  71. package/build/templates/packages/nativewindui/components/HeaderButton.tsx.ejs +31 -0
  72. package/build/templates/packages/nativewindui/components/ScreenContent.tsx.ejs +40 -0
  73. package/build/templates/packages/nativewindui/components/TabBarIcon.tsx.ejs +15 -0
  74. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.ios.tsx.ejs +52 -0
  75. package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.tsx.ejs +58 -0
  76. package/build/templates/packages/nativewindui/components/nativewindui/Icon/index.ts.ejs +16 -0
  77. package/build/templates/packages/nativewindui/components/nativewindui/Icon/types.ts.ejs +18 -0
  78. package/build/templates/packages/nativewindui/components/nativewindui/ThemeToggle.tsx.ejs +33 -0
  79. package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +28 -0
  80. package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/index.tsx.ejs +15 -0
  81. package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/two.tsx.ejs +15 -0
  82. package/build/templates/packages/nativewindui/drawer/app/(drawer)/_layout.tsx.ejs +35 -0
  83. package/build/templates/packages/nativewindui/drawer/app/(drawer)/index.tsx.ejs +535 -0
  84. package/build/templates/packages/nativewindui/drawer/app/+html.tsx.ejs +46 -0
  85. package/build/templates/packages/nativewindui/drawer/app/+not-found.tsx.ejs +83 -0
  86. package/build/templates/packages/nativewindui/drawer/app/_layout.tsx.ejs +75 -0
  87. package/build/templates/packages/nativewindui/drawer/app/modal.tsx.ejs +33 -0
  88. package/build/templates/packages/nativewindui/global.css.ejs +91 -0
  89. package/build/templates/packages/nativewindui/lib/cn.ts.ejs +6 -0
  90. package/build/templates/packages/nativewindui/lib/useColorScheme.tsx.ejs +21 -0
  91. package/build/templates/packages/nativewindui/nativewind-env.d.ts.ejs +1 -0
  92. package/build/templates/packages/nativewindui/stack/app/+html.tsx.ejs +46 -0
  93. package/build/templates/packages/nativewindui/stack/app/+not-found.tsx.ejs +18 -0
  94. package/build/templates/packages/nativewindui/stack/app/_layout.tsx.ejs +78 -0
  95. package/build/templates/packages/nativewindui/stack/app/index.tsx.ejs +487 -0
  96. package/build/templates/packages/nativewindui/stack/app/modal.tsx.ejs +33 -0
  97. package/build/templates/packages/nativewindui/tabs/app/(tabs)/_layout.tsx.ejs +35 -0
  98. package/build/templates/packages/nativewindui/tabs/app/(tabs)/index.tsx.ejs +537 -0
  99. package/build/templates/packages/nativewindui/tabs/app/(tabs)/two.tsx.ejs +22 -0
  100. package/build/templates/packages/nativewindui/tabs/app/+html.tsx.ejs +46 -0
  101. package/build/templates/packages/nativewindui/tabs/app/+not-found.tsx.ejs +90 -0
  102. package/build/templates/packages/nativewindui/tabs/app/_layout.tsx.ejs +78 -0
  103. package/build/templates/packages/nativewindui/tabs/app/modal.tsx.ejs +21 -0
  104. package/build/templates/packages/nativewindui/tailwind.config.js.ejs +67 -0
  105. package/build/templates/packages/nativewindui/theme/colors.ts.ejs +123 -0
  106. package/build/templates/packages/nativewindui/theme/index.ts.ejs +32 -0
  107. package/build/templates/packages/nativewindui/theme/with-opacity.ts.ejs +155 -0
  108. package/build/templates/packages/react-navigation/App.tsx.ejs +73 -0
  109. package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +31 -0
  110. package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +108 -0
  111. package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +38 -0
  112. package/build/templates/packages/react-navigation/screens/details.tsx.ejs +41 -0
  113. package/build/templates/packages/react-navigation/screens/home.tsx.ejs +5 -0
  114. package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +20 -0
  115. package/build/templates/packages/react-navigation/screens/one.tsx.ejs +5 -0
  116. package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +54 -0
  117. package/build/templates/packages/react-navigation/screens/two.tsx.ejs +5 -0
  118. package/build/templates/packages/restyle/components/BackButton.tsx.ejs +19 -0
  119. package/build/templates/packages/restyle/components/Button.tsx.ejs +32 -0
  120. package/build/templates/packages/restyle/components/Container.tsx.ejs +16 -0
  121. package/build/templates/packages/restyle/components/EditScreenInfo.tsx.ejs +38 -0
  122. package/build/templates/packages/restyle/components/ScreenContent.tsx.ejs +30 -0
  123. package/build/templates/packages/restyle/theme.ts.ejs +51 -0
  124. package/build/templates/packages/supabase/.env.ejs +2 -0
  125. package/build/templates/packages/supabase/utils/supabase.ts.ejs +14 -0
  126. package/build/templates/packages/tamagui/components/BackButton.tsx.ejs +12 -0
  127. package/build/templates/packages/tamagui/components/Button.tsx.ejs +17 -0
  128. package/build/templates/packages/tamagui/components/Container.tsx.ejs +12 -0
  129. package/build/templates/packages/tamagui/components/EditScreenInfo.tsx.ejs +27 -0
  130. package/build/templates/packages/tamagui/components/ScreenContent.tsx.ejs +23 -0
  131. package/build/templates/packages/tamagui/tamagui.config.ts.ejs +14 -0
  132. package/build/templates/packages/unistyles/breakpoints.ts.ejs +9 -0
  133. package/build/templates/packages/unistyles/components/BackButton.tsx.ejs +28 -0
  134. package/build/templates/packages/unistyles/components/Button.tsx.ejs +42 -0
  135. package/build/templates/packages/unistyles/components/Container.tsx.ejs +17 -0
  136. package/build/templates/packages/unistyles/components/EditScreenInfo.tsx.ejs +53 -0
  137. package/build/templates/packages/unistyles/components/ScreenContent.tsx.ejs +43 -0
  138. package/build/templates/packages/unistyles/theme.ts.ejs +34 -0
  139. package/build/templates/packages/unistyles/unistyles.ts.ejs +27 -0
  140. package/build/templates/packages/uniwind/global.css +2 -0
  141. package/build/templates/packages/uniwind/metro.config.js.ejs +10 -0
  142. package/build/templates/packages/vexo-analytics/.env.ejs +7 -0
  143. package/build/templates/packages/zustand/store/store.ts.ejs +15 -0
  144. package/build/types/cli.d.ts +4 -0
  145. package/build/types/commands/create-expo-stack.d.ts +3 -0
  146. package/build/types/constants.d.ts +10 -0
  147. package/build/types/types.d.ts +33 -0
  148. package/build/types/utilities/bumpVersion.d.ts +1 -0
  149. package/build/types/utilities/clearNavigationPackages.d.ts +2 -0
  150. package/build/types/utilities/clearStylingPackages.d.ts +2 -0
  151. package/build/types/utilities/configAnalytics.d.ts +18 -0
  152. package/build/types/utilities/configStorage.d.ts +8 -0
  153. package/build/types/utilities/configureProjectFiles.d.ts +3 -0
  154. package/build/types/utilities/copyBaseAssets.d.ts +2 -0
  155. package/build/types/utilities/generateNWUI.d.ts +3 -0
  156. package/build/types/utilities/generateProjectFiles.d.ts +5 -0
  157. package/build/types/utilities/getPackageManager.d.ts +8 -0
  158. package/build/types/utilities/index.d.ts +10 -0
  159. package/build/types/utilities/printOutput.d.ts +3 -0
  160. package/build/types/utilities/publishToGitHub.d.ts +2 -0
  161. package/build/types/utilities/renderTitle.d.ts +2 -0
  162. package/build/types/utilities/runCLI.d.ts +3 -0
  163. package/build/types/utilities/runEasConfigure.d.ts +3 -0
  164. package/build/types/utilities/runIgnite.d.ts +3 -0
  165. package/build/types/utilities/showHelp.d.ts +1 -0
  166. package/build/types/utilities/systemCommand.d.ts +14 -0
  167. package/build/types/utilities/usePackage.d.ts +2 -0
  168. package/build/types/utilities/validateProjectName.d.ts +4 -0
  169. package/build/types.js +39 -0
  170. package/build/utilities/bumpVersion.js +21 -0
  171. package/build/utilities/clearNavigationPackages.js +11 -0
  172. package/build/utilities/clearStylingPackages.js +11 -0
  173. package/build/utilities/configAnalytics.js +70 -0
  174. package/build/utilities/configStorage.js +50 -0
  175. package/build/utilities/configureProjectFiles.js +380 -0
  176. package/build/utilities/copyBaseAssets.js +21 -0
  177. package/build/utilities/generateNWUI.js +54 -0
  178. package/build/utilities/generateProjectFiles.js +106 -0
  179. package/build/utilities/getPackageManager.js +103 -0
  180. package/build/utilities/index.js +27 -0
  181. package/build/utilities/printOutput.js +251 -0
  182. package/build/utilities/publishToGitHub.js +173 -0
  183. package/build/utilities/renderTitle.js +55 -0
  184. package/build/utilities/runCLI.js +437 -0
  185. package/build/utilities/runEasConfigure.js +83 -0
  186. package/build/utilities/runIgnite.js +26 -0
  187. package/build/utilities/showHelp.js +85 -0
  188. package/build/utilities/systemCommand.js +40 -0
  189. package/build/utilities/usePackage.js +8 -0
  190. package/build/utilities/validateProjectName.js +42 -0
  191. package/package.json +77 -0
@@ -0,0 +1,38 @@
1
+ import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
2
+ import { HeaderButton } from '../components/HeaderButton';
3
+ import { TabBarIcon } from '../components/TabBarIcon';
4
+ import One from '../screens/one';
5
+ import Two from '../screens/two';
6
+
7
+ const Tab = createBottomTabNavigator({
8
+ screenOptions: function ScreenOptions() {
9
+ return {
10
+ <% if (props.stylingPackage?.name !== "unistyles") { %>
11
+ tabBarActiveTintColor: 'black',
12
+ <% } %>
13
+ <% if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
14
+ headerShown: false,
15
+ <% } %>
16
+ }
17
+ },
18
+ screens: {
19
+ One: {
20
+ screen: One,
21
+ options: ({ navigation }) => ({
22
+ title: 'Tab One',
23
+ tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
24
+ headerRight: () => <HeaderButton onPress={() => navigation.navigate('Modal')} />,
25
+ })
26
+ },
27
+ Two: {
28
+ screen: Two,
29
+ options: {
30
+ title: 'Tab Two',
31
+ tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
32
+ }
33
+ },
34
+ }
35
+ });
36
+
37
+ export default Tab;
38
+
@@ -0,0 +1,41 @@
1
+ import type { StaticScreenProps } from '@react-navigation/native';
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 {%>
7
+ import { StyleSheet, View } from 'react-native';
8
+ <% } %>
9
+
10
+ type Props = StaticScreenProps<{
11
+ name: string;
12
+ }>;
13
+
14
+ export default function Details({ route }: Props) {
15
+ return (
16
+ <View style={styles.container}>
17
+ <ScreenContent
18
+ path="screens/details.tsx"
19
+ title={`Showing details for user ${route.params?.name}`}
20
+ />
21
+ </View>
22
+ );
23
+ }
24
+
25
+ <% if (props.stylingPackage?.name === "unistyles") { %>
26
+ export const styles = StyleSheet.create((theme, rt) => ({
27
+ container: {
28
+ flex: 1,
29
+ padding: 24,
30
+ backgroundColor: theme.colors.background,
31
+ paddingBottom: rt.insets.bottom,
32
+ },
33
+ }));
34
+ <% } else { %>
35
+ export const styles = StyleSheet.create({
36
+ container: {
37
+ flex: 1,
38
+ padding: 24,
39
+ },
40
+ });
41
+ <% } %>
@@ -0,0 +1,5 @@
1
+ import { ScreenContent } from 'components/ScreenContent';
2
+
3
+ export default function Home() {
4
+ return <ScreenContent path="screens/home.tsx" title="Home" />;
5
+ }
@@ -0,0 +1,20 @@
1
+ import { ScreenContent } from 'components/ScreenContent';
2
+ import { StatusBar } from 'expo-status-bar';
3
+ import { Platform } from 'react-native';
4
+
5
+ <% if (props.internalizationPackage?.name === "i18next") { %>
6
+ import { InternalizationExample } from 'components/InternalizationExample';
7
+ <% } %>
8
+
9
+ export default function Modal() {
10
+ return (
11
+ <>
12
+ <ScreenContent path="screens/modal.tsx" title="Modal">
13
+ <% if (props.internalizationPackage?.name === "i18next") { %>
14
+ <InternalizationExample />
15
+ <% } %>
16
+ </ScreenContent>
17
+ <StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
18
+ </>
19
+ );
20
+ }
@@ -0,0 +1,5 @@
1
+ import { ScreenContent } from 'components/ScreenContent';
2
+
3
+ export default function TabOneScreen() {
4
+ return <ScreenContent path="screens/one.tsx" title="Tab One" />;
5
+ }
@@ -0,0 +1,54 @@
1
+ import { useNavigation } from '@react-navigation/native';
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 {%>
7
+ import { StyleSheet, View } from 'react-native';
8
+ <% } %>
9
+
10
+ <% if (props.internalizationPackage?.name === "i18next") { %>
11
+ import { InternalizationExample } from 'components/InternalizationExample';
12
+ <% } %>
13
+
14
+ import { Button } from '../components/Button';
15
+
16
+ export default function Overview() {
17
+ const navigation = useNavigation();
18
+
19
+ return (
20
+ <View style={styles.container}>
21
+ <ScreenContent path="screens/overview.tsx" title="Overview">
22
+ <% if (props.internalizationPackage?.name === "i18next") { %>
23
+ <InternalizationExample />
24
+ <% } %>
25
+ </ScreenContent>
26
+ <Button
27
+ onPress={() =>
28
+ navigation.navigate('Details', {
29
+ name: 'Dan',
30
+ })
31
+ }
32
+ title="Show Details"
33
+ />
34
+ </View>
35
+ );
36
+ }
37
+
38
+ <% if (props.stylingPackage?.name === "unistyles") { %>
39
+ export const styles = StyleSheet.create((theme, rt) => ({
40
+ container: {
41
+ flex: 1,
42
+ padding: 24,
43
+ backgroundColor: theme.colors.background,
44
+ paddingBottom: rt.insets.bottom,
45
+ },
46
+ }));
47
+ <% } else { %>
48
+ export const styles = StyleSheet.create({
49
+ container: {
50
+ flex: 1,
51
+ padding: 24,
52
+ },
53
+ });
54
+ <% } %>
@@ -0,0 +1,5 @@
1
+ import { ScreenContent } from 'components/ScreenContent';
2
+
3
+ export default function TabTwoScreen() {
4
+ return <ScreenContent path="screens/two.tsx" title="Tab Two" />;
5
+ }
@@ -0,0 +1,19 @@
1
+ import { Pressable } from 'react-native';
2
+ import { createBox, createText } from '@shopify/restyle';
3
+
4
+ import type { Theme } from '../theme';
5
+
6
+ const Box = createBox<Theme>();
7
+ const Text = createText<Theme>();
8
+
9
+ export const BackButton = ({ onPress }: { onPress: () => void }) => {
10
+ return (
11
+ <Pressable onPress={onPress}>
12
+ <Box flexDirection="row" alignItems="center" paddingLeft="lg">
13
+ <Text variant="body" color="primary">
14
+ {'<'} Back
15
+ </Text>
16
+ </Box>
17
+ </Pressable>
18
+ );
19
+ };
@@ -0,0 +1,32 @@
1
+ import { forwardRef } from 'react';
2
+ import { Pressable, View } from 'react-native';
3
+ import { createBox, createText } from '@shopify/restyle';
4
+
5
+ import type { Theme } from '../theme';
6
+
7
+ const Box = createBox<Theme>();
8
+ const Text = createText<Theme>();
9
+
10
+ type ButtonProps = {
11
+ title?: string;
12
+ onPress?: () => void;
13
+ };
14
+
15
+ export const Button = forwardRef<View, ButtonProps>(({ title, onPress }, ref) => {
16
+ return (
17
+ <Pressable ref={ref} onPress={onPress}>
18
+ <Box
19
+ padding="md"
20
+ borderRadius={24}
21
+ alignItems="center"
22
+ justifyContent="center"
23
+ backgroundColor="primary">
24
+ <Text variant="body" color="background">
25
+ {title}
26
+ </Text>
27
+ </Box>
28
+ </Pressable>
29
+ );
30
+ });
31
+
32
+ Button.displayName = 'Button';
@@ -0,0 +1,16 @@
1
+ import { SafeAreaView } from 'react-native';
2
+ import { createBox } from '@shopify/restyle';
3
+
4
+ import type { Theme } from '../theme';
5
+
6
+ const Box = createBox<Theme>();
7
+
8
+ export const Container = ({ children }: { children: React.ReactNode }) => {
9
+ return (
10
+ <SafeAreaView style={{ flex: 1 }}>
11
+ <Box flex={1} padding="lg" backgroundColor="background">
12
+ {children}
13
+ </Box>
14
+ </SafeAreaView>
15
+ );
16
+ };
@@ -0,0 +1,38 @@
1
+ import { createBox, createText } from '@shopify/restyle';
2
+
3
+ import type { Theme } from '../theme';
4
+
5
+ <% if (props.internalizationPackage?.name === "i18next") { %>
6
+ import { useTranslation } from 'react-i18next';
7
+ <% } %>
8
+
9
+ const Box = createBox<Theme>();
10
+ const Text = createText<Theme>();
11
+
12
+ export default function EditScreenInfo({ path }: { path: string }) {
13
+ <% if (props.internalizationPackage?.name === "i18next") { %>
14
+ const { t } = useTranslation();
15
+ const title = t('getStarted');
16
+ const description = t('changeCode')
17
+ <% } else { %>
18
+ const title = 'Open up the code for this screen:';
19
+ const description = 'Change any of the text, save the file, and your app will automatically update.';
20
+ <% } %>
21
+ return (
22
+ <Box alignItems="center" marginHorizontal="lg">
23
+ <Text variant="body" textAlign="center">
24
+ {title}
25
+ </Text>
26
+ <Box
27
+ borderRadius={3}
28
+ paddingHorizontal="sm"
29
+ marginVertical="sm"
30
+ backgroundColor="border">
31
+ <Text variant="muted">{path}</Text>
32
+ </Box>
33
+ <Text variant="muted" textAlign="center">
34
+ {description}
35
+ </Text>
36
+ </Box>
37
+ );
38
+ }
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { createBox, createText } from '@shopify/restyle';
3
+
4
+ import EditScreenInfo from './EditScreenInfo';
5
+ import type { Theme } from '../theme';
6
+
7
+ const Box = createBox<Theme>();
8
+ const Text = createText<Theme>();
9
+
10
+ type ScreenContentProps = {
11
+ title: string;
12
+ path: string;
13
+ children?: React.ReactNode;
14
+ };
15
+
16
+ export const ScreenContent = ({ title, path, children }: ScreenContentProps) => {
17
+ return (
18
+ <Box
19
+ flex={1}
20
+ alignItems="center"
21
+ justifyContent="center"
22
+ padding="lg"
23
+ backgroundColor="background">
24
+ <Text variant="header">{title}</Text>
25
+ <Box height={1} width="80%" backgroundColor="border" marginVertical="lg" />
26
+ <EditScreenInfo path={path} />
27
+ {children}
28
+ </Box>
29
+ );
30
+ };
@@ -0,0 +1,51 @@
1
+ import { createTheme } from '@shopify/restyle';
2
+
3
+ const palette = {
4
+ white: '#FFFFFF',
5
+ black: '#0B0B0B',
6
+ slate: '#5B6670',
7
+ indigo: '#4F46E5',
8
+ gray: '#E5E7EB'
9
+ } as const;
10
+
11
+ export const theme = createTheme({
12
+ colors: {
13
+ background: palette.white,
14
+ text: palette.black,
15
+ muted: palette.slate,
16
+ primary: palette.indigo,
17
+ border: palette.gray
18
+ },
19
+ spacing: {
20
+ xs: 4,
21
+ sm: 8,
22
+ md: 16,
23
+ lg: 24,
24
+ xl: 32
25
+ },
26
+ textVariants: {
27
+ defaults: {
28
+ color: 'text',
29
+ fontSize: 16
30
+ },
31
+ header: {
32
+ color: 'text',
33
+ fontSize: 20,
34
+ fontWeight: '700'
35
+ },
36
+ body: {
37
+ color: 'text',
38
+ fontSize: 16
39
+ },
40
+ muted: {
41
+ color: 'muted',
42
+ fontSize: 14
43
+ }
44
+ },
45
+ breakpoints: {
46
+ phone: 0,
47
+ tablet: 768
48
+ }
49
+ });
50
+
51
+ export type Theme = typeof theme;
@@ -0,0 +1,2 @@
1
+ EXPO_PUBLIC_SUPABASE_URL=
2
+ EXPO_PUBLIC_SUPABASE_ANON_KEY=
@@ -0,0 +1,14 @@
1
+ import AsyncStorage from '@react-native-async-storage/async-storage';
2
+ import { createClient } from '@supabase/supabase-js';
3
+
4
+ const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL;
5
+ const supabaseAnonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY;
6
+
7
+ export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
8
+ auth: {
9
+ storage: AsyncStorage,
10
+ autoRefreshToken: true,
11
+ persistSession: true,
12
+ detectSessionInUrl: false,
13
+ },
14
+ });
@@ -0,0 +1,12 @@
1
+ import { Pressable } from 'react-native';
2
+ import { Text, XStack } from 'tamagui';
3
+
4
+ export const BackButton = ({ onPress }: { onPress: () => void }) => {
5
+ return (
6
+ <Pressable onPress={onPress}>
7
+ <XStack paddingLeft="$4" alignItems="center">
8
+ <Text color="$blue10">{'<'} Back</Text>
9
+ </XStack>
10
+ </Pressable>
11
+ );
12
+ };
@@ -0,0 +1,17 @@
1
+ import { forwardRef } from 'react';
2
+ import { Button as TamaguiButton } from 'tamagui';
3
+ import type { ButtonProps as TamaguiButtonProps, TamaguiElement } from 'tamagui';
4
+
5
+ type ButtonProps = {
6
+ title?: string;
7
+ } & TamaguiButtonProps;
8
+
9
+ export const Button = forwardRef<TamaguiElement, ButtonProps>(({ title, ...props }, ref) => {
10
+ return (
11
+ <TamaguiButton ref={ref} backgroundColor="$blue10" color="white" borderRadius="$8" {...props}>
12
+ {title}
13
+ </TamaguiButton>
14
+ );
15
+ });
16
+
17
+ Button.displayName = 'Button';
@@ -0,0 +1,12 @@
1
+ import { SafeAreaView } from 'react-native';
2
+ import { YStack } from 'tamagui';
3
+
4
+ export const Container = ({ children }: { children: React.ReactNode }) => {
5
+ return (
6
+ <SafeAreaView style={{ flex: 1 }}>
7
+ <YStack flex={1} padding="$6">
8
+ {children}
9
+ </YStack>
10
+ </SafeAreaView>
11
+ );
12
+ };
@@ -0,0 +1,27 @@
1
+ import { Text, YStack } from 'tamagui';
2
+
3
+ <% if (props.internalizationPackage?.name === "i18next") { %>
4
+ import { useTranslation } from 'react-i18next';
5
+ <% } %>
6
+
7
+ export const EditScreenInfo = ({ path }: { path: string }) => {
8
+ <% if (props.internalizationPackage?.name === "i18next") { %>
9
+ const { t } = useTranslation();
10
+ const title = t('getStarted');
11
+ const description = t('changeCode')
12
+ <% } else { %>
13
+ const title = 'Open up the code for this screen:';
14
+ const description = 'Change any of the text, save the file, and your app will automatically update.';
15
+ <% } %>
16
+ return (
17
+ <YStack alignItems="center" gap="$3">
18
+ <Text textAlign="center">{title}</Text>
19
+ <Text textAlign="center" color="$gray8">
20
+ {path}
21
+ </Text>
22
+ <Text textAlign="center" color="$gray8">
23
+ {description}
24
+ </Text>
25
+ </YStack>
26
+ );
27
+ };
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { Separator, Text, YStack } from 'tamagui';
3
+
4
+ import { EditScreenInfo } from './EditScreenInfo';
5
+
6
+ type ScreenContentProps = {
7
+ title: string;
8
+ path: string;
9
+ children?: React.ReactNode;
10
+ };
11
+
12
+ export const ScreenContent = ({ title, path, children }: ScreenContentProps) => {
13
+ return (
14
+ <YStack flex={1} alignItems="center" justifyContent="center" padding="$6" gap="$4">
15
+ <Text fontSize="$6" fontWeight="700">
16
+ {title}
17
+ </Text>
18
+ <Separator alignSelf="stretch" />
19
+ <EditScreenInfo path={path} />
20
+ {children}
21
+ </YStack>
22
+ );
23
+ };
@@ -0,0 +1,14 @@
1
+ import { config } from '@tamagui/config/v3';
2
+ import { createTamagui } from 'tamagui';
3
+
4
+ const appConfig = createTamagui(config);
5
+
6
+ type AppConfig = typeof appConfig;
7
+
8
+ declare module 'tamagui' {
9
+ interface TamaguiCustomConfig extends AppConfig {
10
+ _tamagui?: never;
11
+ }
12
+ }
13
+
14
+ export default appConfig;
@@ -0,0 +1,9 @@
1
+ export const breakpoints = {
2
+ xs: 0,
3
+ sm: 576,
4
+ md: 768,
5
+ lg: 992,
6
+ xl: 1200,
7
+ superLarge: 2000,
8
+ tvLike: 4000
9
+ } as const;
@@ -0,0 +1,28 @@
1
+ import { Feather } from '@expo/vector-icons';
2
+ import { Text, View } from 'react-native';
3
+ import { StyleSheet, withUnistyles } from 'react-native-unistyles';
4
+
5
+ const UniFeather = withUnistyles(Feather, theme => ({
6
+ color: theme.colors.azureRadiance
7
+ }));
8
+
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
+ );
18
+ };
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
+ },
28
+ }));
@@ -0,0 +1,42 @@
1
+ import { forwardRef } from 'react';
2
+ import { Text, TouchableOpacity, TouchableOpacityProps, View } from 'react-native';
3
+ import { StyleSheet } from 'react-native-unistyles';
4
+
5
+ type ButtonProps = {
6
+ title?: string;
7
+ } & TouchableOpacityProps;
8
+
9
+ export const Button = forwardRef<View, ButtonProps>(({ title, ...touchableProps }, ref) => {
10
+ return (
11
+ <TouchableOpacity ref={ref} {...touchableProps} style={[styles.button, touchableProps.style]}>
12
+ <Text style={styles.buttonText}>{title}</Text>
13
+ </TouchableOpacity>
14
+ );
15
+ });
16
+
17
+ Button.displayName = 'Button';
18
+
19
+ const styles = StyleSheet.create(theme => ({
20
+ button: {
21
+ alignItems: 'center',
22
+ backgroundColor: theme.colors.cornflowerBlue,
23
+ borderRadius: 24,
24
+ elevation: 5,
25
+ flexDirection: 'row',
26
+ justifyContent: 'center',
27
+ padding: 16,
28
+ shadowColor: '#000',
29
+ shadowOffset: {
30
+ height: 2,
31
+ width: 0,
32
+ },
33
+ shadowOpacity: 0.25,
34
+ shadowRadius: 3.84,
35
+ },
36
+ buttonText: {
37
+ color: theme.colors.background,
38
+ fontSize: 16,
39
+ fontWeight: '600',
40
+ textAlign: 'center',
41
+ },
42
+ }));
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { View } from 'react-native';
3
+ import { StyleSheet } from 'react-native-unistyles';
4
+
5
+ export const Container = ({ children }: { children: React.ReactNode }) => {
6
+ return (
7
+ <View style={styles.container}>{children}</View>
8
+ );
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
+ }));
@@ -0,0 +1,53 @@
1
+ import { Text, View } from 'react-native';
2
+ import { StyleSheet } from 'react-native-unistyles';
3
+
4
+ <% if (props.internalizationPackage?.name === "i18next") { %>
5
+ import { useTranslation } from 'react-i18next';
6
+ <% } %>
7
+
8
+ export const EditScreenInfo = ({ path }: { path: string }) => {
9
+ <% if (props.internalizationPackage?.name === "i18next") { %>
10
+ const { t } = useTranslation();
11
+ const title = t('getStarted');
12
+ const description = t('changeCode')
13
+ <% } else { %>
14
+ const title = "Open up the code for this screen:"
15
+ const description = "Change any of the text, save the file, and your app will automatically update."
16
+ <% } %>
17
+ return (
18
+ <View>
19
+ <View style={styles.getStartedContainer}>
20
+ <Text style={styles.getStartedText}>{title}</Text>
21
+ <View style={[styles.codeHighlightContainer, styles.homeScreenFilename]}>
22
+ <Text style={styles.text}>{path}</Text>
23
+ </View>
24
+ <Text style={styles.getStartedText}>
25
+ {description}
26
+ </Text>
27
+ </View>
28
+ </View>
29
+ );
30
+ }
31
+
32
+ const styles = StyleSheet.create((theme) => ({
33
+ codeHighlightContainer: {
34
+ borderRadius: 3,
35
+ paddingHorizontal: 4,
36
+ },
37
+ getStartedContainer: {
38
+ alignItems: 'center',
39
+ marginHorizontal: 50,
40
+ },
41
+ text: {
42
+ color: theme.colors.typography,
43
+ },
44
+ getStartedText: {
45
+ fontSize: 17,
46
+ lineHeight: 24,
47
+ textAlign: 'center',
48
+ color: theme.colors.typography,
49
+ },
50
+ homeScreenFilename: {
51
+ marginVertical: 7,
52
+ },
53
+ }));