create-expo-stack 2.1.13 → 2.1.14

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.
@@ -12,6 +12,9 @@ web-build/
12
12
  <% if (props.navigationPackage?.name === "expo-router") { %>
13
13
  expo-env.d.ts
14
14
  <% } %>
15
+ <% if (props.navigationPackage?.name === "tamagui") { %>
16
+ .tamagui/
17
+ <% } %>
15
18
 
16
19
  # macOS
17
20
  .DS_Store
@@ -19,6 +19,7 @@
19
19
  "@tamagui/shorthands": "1.74.8",
20
20
  "@tamagui/themes": "1.74.8",
21
21
  "@tamagui/react-native-media-driver": "1.74.8",
22
+ "expo-font": "~11.4.0",
22
23
  <% } %>
23
24
 
24
25
  <% if (props.navigationPackage?.type === "navigation") { %>
@@ -32,7 +33,11 @@
32
33
  "@react-navigation/stack": "^6.3.17",
33
34
  <% } %>
34
35
 
35
- <% if (props.navigationPackage?.options === "tabs" && props.navigationPackage?.name === "react-navigation") { %>
36
+ <% if ((props.navigationPackage?.name === "react-navigation") && (props.stylingPackage?.name === "tamagui")) { %>
37
+ "expo-splash-screen": "~0.20.5",
38
+ <% } %>
39
+
40
+ <% if (props.navigationPackage?.options.type === "tabs" && props.navigationPackage?.name === "react-navigation") { %>
36
41
  "@react-navigation/bottom-tabs": "^6.5.8",
37
42
  <% } %>
38
43
 
@@ -1,12 +1,19 @@
1
1
  import { Feather } from "@expo/vector-icons";
2
- import { Stack, useRouter } from "expo-router";
3
2
  <% if (props.stylingPackage?.name === "nativewind") { %>
3
+ import { Stack, useRouter } from "expo-router";
4
4
  import { Text, TouchableOpacity, View } from "react-native";
5
5
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
6
+ import React, { useEffect } from "react";
6
7
  import { TamaguiProvider, Button } from "tamagui";
8
+ import { useFonts } from "expo-font";
9
+ import { Stack, useRouter, SplashScreen } from "expo-router";
10
+
7
11
  import config from '../tamagui.config'
12
+
13
+ SplashScreen.preventAutoHideAsync();
8
14
  <% } else { %>
9
15
  import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
16
+ import { Stack, useRouter } from "expo-router";
10
17
  <% } %>
11
18
 
12
19
  export default function Layout() {
@@ -21,6 +28,19 @@ export default function Layout() {
21
28
  </TouchableOpacity>
22
29
  );
23
30
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
31
+ const [loaded] = useFonts({
32
+ Inter: require("@tamagui/font-inter/otf/Inter-Medium.otf"),
33
+ InterBold: require("@tamagui/font-inter/otf/Inter-Bold.otf")
34
+ });
35
+
36
+ useEffect(() => {
37
+ if (loaded) {
38
+ SplashScreen.hideAsync();
39
+ }
40
+ }, [loaded]);
41
+
42
+ if (!loaded) return null;
43
+
24
44
  const BackButton = () => (
25
45
  <Button onPress={router.back} icon={<Feather name="chevron-left" size={16} color="#007AFF" />}>Back</Button>
26
46
  )
@@ -21,7 +21,7 @@ export default function Details() {
21
21
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
22
22
  return (
23
23
  <YStack flex={1} padding="$2">
24
- <YStack flex={1} maxWidth={960}>
24
+ <YStack flex={1} maxWidth="100%">
25
25
  <H2>Details</H2>
26
26
  <Paragraph theme="alt1">Showing details for user {name}.</Paragraph>
27
27
  </YStack>
@@ -27,7 +27,7 @@ export default function Page() {
27
27
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
28
28
  return (
29
29
  <YStack flex={1} padding="$3">
30
- <YStack flex={1} maxWidth="{960}" justifyContent="space-between">
30
+ <YStack flex={1} maxWidth="100%" justifyContent="space-between">
31
31
  <YStack>
32
32
  <H2>Hello World</H2>
33
33
  <Paragraph>This is the first page of your app.</Paragraph>
@@ -1,7 +1,15 @@
1
1
  import { Stack } from "expo-router";
2
2
  <% if (props.stylingPackage?.name === "tamagui") { %>
3
- import { TamaguiProvider } from 'tamagui'
4
- import config from './tamagui.config'
3
+ import React, { useEffect } from "react";
4
+ import { TamaguiProvider } from 'tamagui'
5
+ import { SplashScreen, Stack } from "expo-router";
6
+ import { useFonts } from "expo-font";
7
+
8
+ import config from '../tamagui.config'
9
+
10
+ SplashScreen.preventAutoHideAsync();
11
+ <% } else { %>
12
+ import { Stack } from "expo-router";
5
13
  <% } %>
6
14
 
7
15
  export const unstable_settings = {
@@ -10,6 +18,21 @@ export const unstable_settings = {
10
18
  };
11
19
 
12
20
  export default function RootLayout() {
21
+ <% if (props.stylingPackage?.name === "tamagui") { %>
22
+ const [loaded] = useFonts({
23
+ Inter: require("@tamagui/font-inter/otf/Inter-Medium.otf"),
24
+ InterBold: require("@tamagui/font-inter/otf/Inter-Bold.otf")
25
+ });
26
+
27
+ useEffect(() => {
28
+ if (loaded) {
29
+ SplashScreen.hideAsync();
30
+ }
31
+ }, [loaded]);
32
+
33
+ if (!loaded) return null;
34
+ <% } %>
35
+
13
36
  return (
14
37
  <% if (props.stylingPackage?.name === "tamagui") { %>
15
38
  <TamaguiProvider config={config}>
@@ -2,7 +2,7 @@
2
2
  module.exports = {
3
3
  <% if (props.navigationPackage?.name === "react-navigation") { %>
4
4
  content: ["./App.{js,ts,tsx}", "./src/**/*.{js,ts,tsx}"],
5
- <% } else if (props.navigationPackage?.name === "expo-router" && props.navigationPackage?.options === 'tabs') { %>
5
+ <% } else if (props.navigationPackage?.name === "expo-router" && props.navigationPackage?.options.type === 'tabs') { %>
6
6
  content: ["./index.{js,ts,tsx}", "./app/**/*.{js,ts,tsx}", "./components/**/*.{js,ts,tsx}"],
7
7
  <% } else if (props.navigationPackage?.name === "expo-router") { %>
8
8
  content: ["./index.{js,ts,tsx}", "./app/**/*.{js,ts,tsx}"],
@@ -1,17 +1,39 @@
1
1
  import "react-native-gesture-handler";
2
- import RootStack from "./src/navigation";
3
2
  <% if (props.stylingPackage?.name === "tamagui") { %>
4
- import { TamaguiProvider } from 'tamagui'
3
+ import React, { useEffect } from "react";
4
+ import { TamaguiProvider } from 'tamagui';
5
+ import * as SplashScreen from 'expo-splash-screen';
6
+ import { useFonts } from 'expo-font';
7
+
5
8
  import config from './tamagui.config'
9
+
10
+ SplashScreen.preventAutoHideAsync();
6
11
  <% } %>
12
+ import RootStack from "./src/navigation";
13
+
7
14
  export default function App() {
8
- return (
9
- <% if (props.stylingPackage?.name === "tamagui") { %>
10
- <TamaguiProvider config={config}>
11
- <% } %>
12
- <RootStack />
13
- <% if (props.stylingPackage?.name === "tamagui") { %>
14
- </TamaguiProvider>
15
- <% } %>
16
- );
15
+ <% if (props.stylingPackage?.name === "tamagui") { %>
16
+ const [loaded] = useFonts({
17
+ Inter: require("@tamagui/font-inter/otf/Inter-Medium.otf"),
18
+ InterBold: require("@tamagui/font-inter/otf/Inter-Bold.otf"),
19
+ });
20
+
21
+ useEffect(() => {
22
+ if (loaded) {
23
+ SplashScreen.hideAsync();
24
+ }
25
+ }, [loaded])
26
+
27
+ if (!loaded) {
28
+ return null;
29
+ }
30
+
31
+ return (
32
+ <TamaguiProvider config={config}>
33
+ <RootStack />
34
+ </TamaguiProvider>
35
+ );
36
+ <% } else { %>
37
+ return <RootStack />;
38
+ <% } %>
17
39
  }
@@ -24,7 +24,7 @@ export default function Details() {
24
24
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
25
25
  return (
26
26
  <YStack flex={1} paddingTop="$2">
27
- <YStack flex={1} maxWidth={960}>
27
+ <YStack flex={1} maxWidth="100%">
28
28
  <H2>Details</H2>
29
29
  <Paragraph>Showing details for user {router.params.name}.</Paragraph>
30
30
  </YStack>
@@ -30,7 +30,7 @@ export default function Overview() {
30
30
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
31
31
  return (
32
32
  <YStack flex={1} padding="$3">
33
- <YStack flex={1} maxWidth="{960}" justifyContent="space-between">
33
+ <YStack flex={1} maxWidth="100%" justifyContent="space-between">
34
34
  <YStack>
35
35
  <H2>Hello World</H2>
36
36
  <Paragraph>This is the first page of your app.</Paragraph>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-expo-stack",
3
- "version": "2.1.13",
3
+ "version": "2.1.14",
4
4
  "description": "create-expo-stack CLI",
5
5
  "private": false,
6
6
  "types": "build/types/types.d.ts",