lovdacn 0.0.3 → 0.1.1

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 (120) hide show
  1. package/{templates/nativewind/LICENSE → LICENSE} +3 -3
  2. package/dist/index.js +77 -77
  3. package/package.json +51 -52
  4. package/templates/nativewind/.vscode/extensions.json +0 -1
  5. package/templates/nativewind/.vscode/settings.json +0 -7
  6. package/templates/nativewind/AGENTS.md +0 -3
  7. package/templates/nativewind/CLAUDE.md +0 -1
  8. package/templates/nativewind/README.md +0 -56
  9. package/templates/nativewind/app.json +0 -43
  10. package/templates/nativewind/assets/expo.icon/Assets/expo-symbol 2.svg +0 -3
  11. package/templates/nativewind/assets/expo.icon/Assets/grid.png +0 -0
  12. package/templates/nativewind/assets/expo.icon/icon.json +0 -40
  13. package/templates/nativewind/assets/images/android-icon-background.png +0 -0
  14. package/templates/nativewind/assets/images/android-icon-foreground.png +0 -0
  15. package/templates/nativewind/assets/images/android-icon-monochrome.png +0 -0
  16. package/templates/nativewind/assets/images/expo-badge-white.png +0 -0
  17. package/templates/nativewind/assets/images/expo-badge.png +0 -0
  18. package/templates/nativewind/assets/images/expo-logo.png +0 -0
  19. package/templates/nativewind/assets/images/favicon.png +0 -0
  20. package/templates/nativewind/assets/images/icon.png +0 -0
  21. package/templates/nativewind/assets/images/logo-glow.png +0 -0
  22. package/templates/nativewind/assets/images/react-logo.png +0 -0
  23. package/templates/nativewind/assets/images/react-logo@2x.png +0 -0
  24. package/templates/nativewind/assets/images/react-logo@3x.png +0 -0
  25. package/templates/nativewind/assets/images/splash-icon.png +0 -0
  26. package/templates/nativewind/assets/images/tabIcons/explore.png +0 -0
  27. package/templates/nativewind/assets/images/tabIcons/explore@2x.png +0 -0
  28. package/templates/nativewind/assets/images/tabIcons/explore@3x.png +0 -0
  29. package/templates/nativewind/assets/images/tabIcons/home.png +0 -0
  30. package/templates/nativewind/assets/images/tabIcons/home@2x.png +0 -0
  31. package/templates/nativewind/assets/images/tabIcons/home@3x.png +0 -0
  32. package/templates/nativewind/assets/images/tutorial-web.png +0 -0
  33. package/templates/nativewind/babel.config.js +0 -9
  34. package/templates/nativewind/expo-env.d.ts +0 -3
  35. package/templates/nativewind/lvcn.json +0 -16
  36. package/templates/nativewind/metro.config.js +0 -6
  37. package/templates/nativewind/nativewind-env.d.ts +0 -3
  38. package/templates/nativewind/package.json +0 -55
  39. package/templates/nativewind/postcss.config.js +0 -6
  40. package/templates/nativewind/scripts/reset-project.js +0 -114
  41. package/templates/nativewind/src/app/_layout.tsx +0 -25
  42. package/templates/nativewind/src/app/explore.tsx +0 -180
  43. package/templates/nativewind/src/app/index.tsx +0 -12
  44. package/templates/nativewind/src/components/animated-icon.module.css +0 -6
  45. package/templates/nativewind/src/components/animated-icon.tsx +0 -148
  46. package/templates/nativewind/src/components/animated-icon.web.tsx +0 -108
  47. package/templates/nativewind/src/components/app-tabs.tsx +0 -32
  48. package/templates/nativewind/src/components/app-tabs.web.tsx +0 -115
  49. package/templates/nativewind/src/components/external-link.tsx +0 -25
  50. package/templates/nativewind/src/components/hint-row.tsx +0 -35
  51. package/templates/nativewind/src/components/themed-text.tsx +0 -73
  52. package/templates/nativewind/src/components/themed-view.tsx +0 -16
  53. package/templates/nativewind/src/components/ui/button.tsx +0 -106
  54. package/templates/nativewind/src/components/ui/collapsible.tsx +0 -65
  55. package/templates/nativewind/src/components/ui/text.tsx +0 -89
  56. package/templates/nativewind/src/components/web-badge.tsx +0 -43
  57. package/templates/nativewind/src/constants/theme.ts +0 -65
  58. package/templates/nativewind/src/global.css +0 -13
  59. package/templates/nativewind/src/hooks/use-color-scheme.ts +0 -1
  60. package/templates/nativewind/src/hooks/use-color-scheme.web.ts +0 -21
  61. package/templates/nativewind/src/hooks/use-theme.ts +0 -14
  62. package/templates/nativewind/tailwind.config.js +0 -86
  63. package/templates/nativewind/tsconfig.json +0 -21
  64. package/templates/uniwind/.claude/settings.json +0 -5
  65. package/templates/uniwind/.vscode/extensions.json +0 -1
  66. package/templates/uniwind/.vscode/settings.json +0 -7
  67. package/templates/uniwind/AGENTS.md +0 -3
  68. package/templates/uniwind/CLAUDE.md +0 -1
  69. package/templates/uniwind/LICENSE +0 -21
  70. package/templates/uniwind/README.md +0 -56
  71. package/templates/uniwind/app.json +0 -42
  72. package/templates/uniwind/assets/expo.icon/Assets/expo-symbol 2.svg +0 -3
  73. package/templates/uniwind/assets/expo.icon/Assets/grid.png +0 -0
  74. package/templates/uniwind/assets/expo.icon/icon.json +0 -40
  75. package/templates/uniwind/assets/images/android-icon-background.png +0 -0
  76. package/templates/uniwind/assets/images/android-icon-foreground.png +0 -0
  77. package/templates/uniwind/assets/images/android-icon-monochrome.png +0 -0
  78. package/templates/uniwind/assets/images/expo-badge-white.png +0 -0
  79. package/templates/uniwind/assets/images/expo-badge.png +0 -0
  80. package/templates/uniwind/assets/images/expo-logo.png +0 -0
  81. package/templates/uniwind/assets/images/favicon.png +0 -0
  82. package/templates/uniwind/assets/images/icon.png +0 -0
  83. package/templates/uniwind/assets/images/logo-glow.png +0 -0
  84. package/templates/uniwind/assets/images/react-logo.png +0 -0
  85. package/templates/uniwind/assets/images/react-logo@2x.png +0 -0
  86. package/templates/uniwind/assets/images/react-logo@3x.png +0 -0
  87. package/templates/uniwind/assets/images/splash-icon.png +0 -0
  88. package/templates/uniwind/assets/images/tabIcons/explore.png +0 -0
  89. package/templates/uniwind/assets/images/tabIcons/explore@2x.png +0 -0
  90. package/templates/uniwind/assets/images/tabIcons/explore@3x.png +0 -0
  91. package/templates/uniwind/assets/images/tabIcons/home.png +0 -0
  92. package/templates/uniwind/assets/images/tabIcons/home@2x.png +0 -0
  93. package/templates/uniwind/assets/images/tabIcons/home@3x.png +0 -0
  94. package/templates/uniwind/assets/images/tutorial-web.png +0 -0
  95. package/templates/uniwind/expo-env.d.ts +0 -3
  96. package/templates/uniwind/lvcn.json +0 -16
  97. package/templates/uniwind/metro.config.js +0 -14
  98. package/templates/uniwind/package.json +0 -46
  99. package/templates/uniwind/scripts/reset-project.js +0 -114
  100. package/templates/uniwind/src/app/_layout.tsx +0 -23
  101. package/templates/uniwind/src/app/explore.tsx +0 -180
  102. package/templates/uniwind/src/app/index.tsx +0 -98
  103. package/templates/uniwind/src/components/animated-icon.module.css +0 -6
  104. package/templates/uniwind/src/components/animated-icon.tsx +0 -148
  105. package/templates/uniwind/src/components/animated-icon.web.tsx +0 -108
  106. package/templates/uniwind/src/components/app-tabs.tsx +0 -32
  107. package/templates/uniwind/src/components/app-tabs.web.tsx +0 -115
  108. package/templates/uniwind/src/components/external-link.tsx +0 -25
  109. package/templates/uniwind/src/components/hint-row.tsx +0 -35
  110. package/templates/uniwind/src/components/themed-text.tsx +0 -73
  111. package/templates/uniwind/src/components/themed-view.tsx +0 -16
  112. package/templates/uniwind/src/components/ui/collapsible.tsx +0 -65
  113. package/templates/uniwind/src/components/web-badge.tsx +0 -43
  114. package/templates/uniwind/src/constants/theme.ts +0 -65
  115. package/templates/uniwind/src/global.css +0 -12
  116. package/templates/uniwind/src/hooks/use-color-scheme.ts +0 -1
  117. package/templates/uniwind/src/hooks/use-color-scheme.web.ts +0 -21
  118. package/templates/uniwind/src/hooks/use-theme.ts +0 -14
  119. package/templates/uniwind/src/uniwind-types.d.ts +0 -10
  120. package/templates/uniwind/tsconfig.json +0 -20
@@ -1,180 +0,0 @@
1
- import { Image } from 'expo-image';
2
- import { SymbolView } from 'expo-symbols';
3
- import { Platform, Pressable, ScrollView, StyleSheet } from 'react-native';
4
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
-
6
- import { ExternalLink } from '@/components/external-link';
7
- import { ThemedText } from '@/components/themed-text';
8
- import { ThemedView } from '@/components/themed-view';
9
- import { Collapsible } from '@/components/ui/collapsible';
10
- import { WebBadge } from '@/components/web-badge';
11
- import { BottomTabInset, MaxContentWidth, Spacing } from '@/constants/theme';
12
- import { useTheme } from '@/hooks/use-theme';
13
-
14
- export default function TabTwoScreen() {
15
- const safeAreaInsets = useSafeAreaInsets();
16
- const insets = {
17
- ...safeAreaInsets,
18
- bottom: safeAreaInsets.bottom + BottomTabInset + Spacing.three,
19
- };
20
- const theme = useTheme();
21
-
22
- const contentPlatformStyle = Platform.select({
23
- android: {
24
- paddingTop: insets.top,
25
- paddingLeft: insets.left,
26
- paddingRight: insets.right,
27
- paddingBottom: insets.bottom,
28
- },
29
- web: {
30
- paddingTop: Spacing.six,
31
- paddingBottom: Spacing.four,
32
- },
33
- });
34
-
35
- return (
36
- <ScrollView
37
- style={[styles.scrollView, { backgroundColor: theme.background }]}
38
- contentInset={insets}
39
- contentContainerStyle={[styles.contentContainer, contentPlatformStyle]}>
40
- <ThemedView style={styles.container}>
41
- <ThemedView style={styles.titleContainer}>
42
- <ThemedText type="subtitle">Explore</ThemedText>
43
- <ThemedText style={styles.centerText} themeColor="textSecondary">
44
- This starter app includes example{'\n'}code to help you get started.
45
- </ThemedText>
46
-
47
- <ExternalLink href="https://docs.expo.dev" asChild>
48
- <Pressable style={({ pressed }) => pressed && styles.pressed}>
49
- <ThemedView type="backgroundElement" style={styles.linkButton}>
50
- <ThemedText type="link">Expo documentation</ThemedText>
51
- <SymbolView
52
- tintColor={theme.text}
53
- name={{ ios: 'arrow.up.right.square', android: 'link', web: 'link' }}
54
- size={12}
55
- />
56
- </ThemedView>
57
- </Pressable>
58
- </ExternalLink>
59
- </ThemedView>
60
-
61
- <ThemedView style={styles.sectionsWrapper}>
62
- <Collapsible title="File-based routing">
63
- <ThemedText type="small">
64
- This app has two screens: <ThemedText type="code">src/app/index.tsx</ThemedText> and{' '}
65
- <ThemedText type="code">src/app/explore.tsx</ThemedText>
66
- </ThemedText>
67
- <ThemedText type="small">
68
- The layout file in <ThemedText type="code">src/app/_layout.tsx</ThemedText> sets up
69
- the tab navigator.
70
- </ThemedText>
71
- <ExternalLink href="https://docs.expo.dev/router/introduction">
72
- <ThemedText type="linkPrimary">Learn more</ThemedText>
73
- </ExternalLink>
74
- </Collapsible>
75
-
76
- <Collapsible title="Android, iOS, and web support">
77
- <ThemedView type="backgroundElement" style={styles.collapsibleContent}>
78
- <ThemedText type="small">
79
- You can open this project on Android, iOS, and the web. To open the web version,
80
- press <ThemedText type="smallBold">w</ThemedText> in the terminal running this
81
- project.
82
- </ThemedText>
83
- <Image
84
- source={require('@/assets/images/tutorial-web.png')}
85
- style={styles.imageTutorial}
86
- />
87
- </ThemedView>
88
- </Collapsible>
89
-
90
- <Collapsible title="Images">
91
- <ThemedText type="small">
92
- For static images, you can use the <ThemedText type="code">@2x</ThemedText> and{' '}
93
- <ThemedText type="code">@3x</ThemedText> suffixes to provide files for different
94
- screen densities.
95
- </ThemedText>
96
- <Image source={require('@/assets/images/react-logo.png')} style={styles.imageReact} />
97
- <ExternalLink href="https://reactnative.dev/docs/images">
98
- <ThemedText type="linkPrimary">Learn more</ThemedText>
99
- </ExternalLink>
100
- </Collapsible>
101
-
102
- <Collapsible title="Light and dark mode components">
103
- <ThemedText type="small">
104
- This template has light and dark mode support. The{' '}
105
- <ThemedText type="code">useColorScheme()</ThemedText> hook lets you inspect what the
106
- user&apos;s current color scheme is, and so you can adjust UI colors accordingly.
107
- </ThemedText>
108
- <ExternalLink href="https://docs.expo.dev/develop/user-interface/color-themes/">
109
- <ThemedText type="linkPrimary">Learn more</ThemedText>
110
- </ExternalLink>
111
- </Collapsible>
112
-
113
- <Collapsible title="Animations">
114
- <ThemedText type="small">
115
- This template includes an example of an animated component. The{' '}
116
- <ThemedText type="code">src/components/ui/collapsible.tsx</ThemedText> component uses
117
- the powerful <ThemedText type="code">react-native-reanimated</ThemedText> library to
118
- animate opening this hint.
119
- </ThemedText>
120
- </Collapsible>
121
- </ThemedView>
122
- {Platform.OS === 'web' && <WebBadge />}
123
- </ThemedView>
124
- </ScrollView>
125
- );
126
- }
127
-
128
- const styles = StyleSheet.create({
129
- scrollView: {
130
- flex: 1,
131
- },
132
- contentContainer: {
133
- flexDirection: 'row',
134
- justifyContent: 'center',
135
- },
136
- container: {
137
- maxWidth: MaxContentWidth,
138
- flexGrow: 1,
139
- },
140
- titleContainer: {
141
- gap: Spacing.three,
142
- alignItems: 'center',
143
- paddingHorizontal: Spacing.four,
144
- paddingVertical: Spacing.six,
145
- },
146
- centerText: {
147
- textAlign: 'center',
148
- },
149
- pressed: {
150
- opacity: 0.7,
151
- },
152
- linkButton: {
153
- flexDirection: 'row',
154
- paddingHorizontal: Spacing.four,
155
- paddingVertical: Spacing.two,
156
- borderRadius: Spacing.five,
157
- justifyContent: 'center',
158
- gap: Spacing.one,
159
- alignItems: 'center',
160
- },
161
- sectionsWrapper: {
162
- gap: Spacing.five,
163
- paddingHorizontal: Spacing.four,
164
- paddingTop: Spacing.three,
165
- },
166
- collapsibleContent: {
167
- alignItems: 'center',
168
- },
169
- imageTutorial: {
170
- width: '100%',
171
- aspectRatio: 296 / 171,
172
- borderRadius: Spacing.three,
173
- marginTop: Spacing.two,
174
- },
175
- imageReact: {
176
- width: 100,
177
- height: 100,
178
- alignSelf: 'center',
179
- },
180
- });
@@ -1,12 +0,0 @@
1
- import { Text, View } from "react-native";
2
- import "./global.css";
3
-
4
- export default function App() {
5
- return (
6
- <View className="flex-1 items-center justify-center">
7
- <Text className="text-xl font-bold text-3xl bg-yellow-500">
8
- Welcome to Nativewind!
9
- </Text>
10
- </View>
11
- );
12
- }
@@ -1,6 +0,0 @@
1
- .expoLogoBackground {
2
- background-image: linear-gradient(180deg, #3c9ffe, #0274df);
3
- border-radius: 40px;
4
- width: 128px;
5
- height: 128px;
6
- }
@@ -1,148 +0,0 @@
1
- import { Image } from 'expo-image';
2
- import * as SplashScreen from 'expo-splash-screen';
3
- import { useState } from 'react';
4
- import { Dimensions, StyleSheet, View } from 'react-native';
5
- import Animated, { Easing, Keyframe } from 'react-native-reanimated';
6
- import { scheduleOnRN } from 'react-native-worklets';
7
-
8
- const INITIAL_SCALE_FACTOR = Dimensions.get('screen').height / 90;
9
- const DURATION = 600;
10
-
11
- export function AnimatedSplashOverlay() {
12
- const [animate, setAnimate] = useState(false);
13
- const [visible, setVisible] = useState(true);
14
-
15
- if (!visible) return null;
16
-
17
- const splashKeyframe = new Keyframe({
18
- 0: {
19
- transform: [{ scale: 1 }],
20
- opacity: 1,
21
- },
22
- 20: {
23
- opacity: 1,
24
- },
25
- 70: {
26
- opacity: 0,
27
- easing: Easing.elastic(0.7),
28
- },
29
- 100: {
30
- opacity: 0,
31
- transform: [{ scale: 1 }],
32
- easing: Easing.elastic(0.7),
33
- },
34
- });
35
-
36
- const image = <Image style={styles.image} source={require('@/assets/images/expo-logo.png')} />;
37
-
38
- return animate ? (
39
- <Animated.View
40
- entering={splashKeyframe.duration(DURATION).withCallback((finished) => {
41
- 'worklet';
42
- if (finished) {
43
- scheduleOnRN(setVisible, false);
44
- }
45
- })}
46
- style={styles.splashOverlay}>
47
- {image}
48
- </Animated.View>
49
- ) : (
50
- <View
51
- onLayout={() => {
52
- SplashScreen.hideAsync().finally(() => {
53
- setAnimate(true);
54
- });
55
- }}
56
- style={styles.splashOverlay}>
57
- {image}
58
- </View>
59
- );
60
- }
61
-
62
- const keyframe = new Keyframe({
63
- 0: {
64
- transform: [{ scale: INITIAL_SCALE_FACTOR }],
65
- },
66
- 100: {
67
- transform: [{ scale: 1 }],
68
- easing: Easing.elastic(0.7),
69
- },
70
- });
71
-
72
- const logoKeyframe = new Keyframe({
73
- 0: {
74
- transform: [{ scale: 1.3 }],
75
- opacity: 0,
76
- },
77
- 40: {
78
- transform: [{ scale: 1.3 }],
79
- opacity: 0,
80
- easing: Easing.elastic(0.7),
81
- },
82
- 100: {
83
- opacity: 1,
84
- transform: [{ scale: 1 }],
85
- easing: Easing.elastic(0.7),
86
- },
87
- });
88
-
89
- const glowKeyframe = new Keyframe({
90
- 0: {
91
- transform: [{ rotateZ: '0deg' }],
92
- },
93
- 100: {
94
- transform: [{ rotateZ: '7200deg' }],
95
- },
96
- });
97
-
98
- export function AnimatedIcon() {
99
- return (
100
- <View style={styles.iconContainer}>
101
- <Animated.View entering={glowKeyframe.duration(60 * 1000 * 4)} style={styles.glow}>
102
- <Image style={styles.glow} source={require('@/assets/images/logo-glow.png')} />
103
- </Animated.View>
104
-
105
- <Animated.View entering={keyframe.duration(DURATION)} style={styles.background} />
106
- <Animated.View style={styles.imageContainer} entering={logoKeyframe.duration(DURATION)}>
107
- <Image style={styles.image} source={require('@/assets/images/expo-logo.png')} />
108
- </Animated.View>
109
- </View>
110
- );
111
- }
112
-
113
- const styles = StyleSheet.create({
114
- imageContainer: {
115
- justifyContent: 'center',
116
- alignItems: 'center',
117
- },
118
- glow: {
119
- width: 201,
120
- height: 201,
121
- position: 'absolute',
122
- },
123
- iconContainer: {
124
- justifyContent: 'center',
125
- alignItems: 'center',
126
- width: 128,
127
- height: 128,
128
- zIndex: 100,
129
- },
130
- image: {
131
- width: 76,
132
- height: 71,
133
- },
134
- background: {
135
- borderRadius: 40,
136
- experimental_backgroundImage: `linear-gradient(180deg, #3C9FFE, #0274DF)`,
137
- width: 128,
138
- height: 128,
139
- position: 'absolute',
140
- },
141
- splashOverlay: {
142
- ...StyleSheet.absoluteFill,
143
- backgroundColor: '#208AEF',
144
- alignItems: 'center',
145
- justifyContent: 'center',
146
- zIndex: 1000,
147
- },
148
- });
@@ -1,108 +0,0 @@
1
- import { Image } from 'expo-image';
2
- import { StyleSheet, View } from 'react-native';
3
- import Animated, { Keyframe, Easing } from 'react-native-reanimated';
4
-
5
- import classes from './animated-icon.module.css';
6
- const DURATION = 300;
7
-
8
- export function AnimatedSplashOverlay() {
9
- return null;
10
- }
11
-
12
- const keyframe = new Keyframe({
13
- 0: {
14
- transform: [{ scale: 0 }],
15
- },
16
- 60: {
17
- transform: [{ scale: 1.2 }],
18
- easing: Easing.elastic(1.2),
19
- },
20
- 100: {
21
- transform: [{ scale: 1 }],
22
- easing: Easing.elastic(1.2),
23
- },
24
- });
25
-
26
- const logoKeyframe = new Keyframe({
27
- 0: {
28
- opacity: 0,
29
- },
30
- 60: {
31
- transform: [{ scale: 1.2 }],
32
- opacity: 0,
33
- easing: Easing.elastic(1.2),
34
- },
35
- 100: {
36
- transform: [{ scale: 1 }],
37
- opacity: 1,
38
- easing: Easing.elastic(1.2),
39
- },
40
- });
41
-
42
- const glowKeyframe = new Keyframe({
43
- 0: {
44
- transform: [{ rotateZ: '-180deg' }, { scale: 0.8 }],
45
- opacity: 0,
46
- },
47
- [DURATION / 1000]: {
48
- transform: [{ rotateZ: '0deg' }, { scale: 1 }],
49
- opacity: 1,
50
- easing: Easing.elastic(0.7),
51
- },
52
- 100: {
53
- transform: [{ rotateZ: '7200deg' }],
54
- },
55
- });
56
-
57
- export function AnimatedIcon() {
58
- return (
59
- <View style={styles.iconContainer}>
60
- <Animated.View entering={glowKeyframe.duration(60 * 1000 * 4)} style={styles.glow}>
61
- <Image style={styles.glow} source={require('@/assets/images/logo-glow.png')} />
62
- </Animated.View>
63
-
64
- <Animated.View style={styles.background} entering={keyframe.duration(DURATION)}>
65
- <div className={classes.expoLogoBackground} />
66
- </Animated.View>
67
-
68
- <Animated.View style={styles.imageContainer} entering={logoKeyframe.duration(DURATION)}>
69
- <Image style={styles.image} source={require('@/assets/images/expo-logo.png')} />
70
- </Animated.View>
71
- </View>
72
- );
73
- }
74
-
75
- const styles = StyleSheet.create({
76
- container: {
77
- alignItems: 'center',
78
- width: '100%',
79
- zIndex: 1000,
80
- position: 'absolute',
81
- top: 128 / 2 + 138,
82
- },
83
- imageContainer: {
84
- justifyContent: 'center',
85
- alignItems: 'center',
86
- },
87
- glow: {
88
- width: 201,
89
- height: 201,
90
- position: 'absolute',
91
- },
92
- iconContainer: {
93
- justifyContent: 'center',
94
- alignItems: 'center',
95
- width: 128,
96
- height: 128,
97
- },
98
- image: {
99
- position: 'absolute',
100
- width: 76,
101
- height: 71,
102
- },
103
- background: {
104
- width: 128,
105
- height: 128,
106
- position: 'absolute',
107
- },
108
- });
@@ -1,32 +0,0 @@
1
- import { NativeTabs } from 'expo-router/unstable-native-tabs';
2
- import { useColorScheme } from 'react-native';
3
-
4
- import { Colors } from '@/constants/theme';
5
-
6
- export default function AppTabs() {
7
- const scheme = useColorScheme();
8
- const colors = Colors[scheme === 'unspecified' ? 'light' : scheme];
9
-
10
- return (
11
- <NativeTabs
12
- backgroundColor={colors.background}
13
- indicatorColor={colors.backgroundElement}
14
- labelStyle={{ selected: { color: colors.text } }}>
15
- <NativeTabs.Trigger name="index">
16
- <NativeTabs.Trigger.Label>Home</NativeTabs.Trigger.Label>
17
- <NativeTabs.Trigger.Icon
18
- src={require('@/assets/images/tabIcons/home.png')}
19
- renderingMode="template"
20
- />
21
- </NativeTabs.Trigger>
22
-
23
- <NativeTabs.Trigger name="explore">
24
- <NativeTabs.Trigger.Label>Explore</NativeTabs.Trigger.Label>
25
- <NativeTabs.Trigger.Icon
26
- src={require('@/assets/images/tabIcons/explore.png')}
27
- renderingMode="template"
28
- />
29
- </NativeTabs.Trigger>
30
- </NativeTabs>
31
- );
32
- }
@@ -1,115 +0,0 @@
1
- import {
2
- Tabs,
3
- TabList,
4
- TabTrigger,
5
- TabSlot,
6
- TabTriggerSlotProps,
7
- TabListProps,
8
- } from 'expo-router/ui';
9
- import { SymbolView } from 'expo-symbols';
10
- import { Pressable, useColorScheme, View, StyleSheet } from 'react-native';
11
-
12
- import { ExternalLink } from './external-link';
13
- import { ThemedText } from './themed-text';
14
- import { ThemedView } from './themed-view';
15
-
16
- import { Colors, MaxContentWidth, Spacing } from '@/constants/theme';
17
-
18
- export default function AppTabs() {
19
- return (
20
- <Tabs>
21
- <TabSlot style={{ height: '100%' }} />
22
- <TabList asChild>
23
- <CustomTabList>
24
- <TabTrigger name="home" href="/" asChild>
25
- <TabButton>Home</TabButton>
26
- </TabTrigger>
27
- <TabTrigger name="explore" href="/explore" asChild>
28
- <TabButton>Explore</TabButton>
29
- </TabTrigger>
30
- </CustomTabList>
31
- </TabList>
32
- </Tabs>
33
- );
34
- }
35
-
36
- export function TabButton({ children, isFocused, ...props }: TabTriggerSlotProps) {
37
- return (
38
- <Pressable {...props} style={({ pressed }) => pressed && styles.pressed}>
39
- <ThemedView
40
- type={isFocused ? 'backgroundSelected' : 'backgroundElement'}
41
- style={styles.tabButtonView}>
42
- <ThemedText type="small" themeColor={isFocused ? 'text' : 'textSecondary'}>
43
- {children}
44
- </ThemedText>
45
- </ThemedView>
46
- </Pressable>
47
- );
48
- }
49
-
50
- export function CustomTabList(props: TabListProps) {
51
- const scheme = useColorScheme();
52
- const colors = Colors[scheme === 'unspecified' ? 'light' : scheme];
53
-
54
- return (
55
- <View {...props} style={styles.tabListContainer}>
56
- <ThemedView type="backgroundElement" style={styles.innerContainer}>
57
- <ThemedText type="smallBold" style={styles.brandText}>
58
- Expo Starter
59
- </ThemedText>
60
-
61
- {props.children}
62
-
63
- <ExternalLink href="https://docs.expo.dev" asChild>
64
- <Pressable style={styles.externalPressable}>
65
- <ThemedText type="link">Docs</ThemedText>
66
- <SymbolView
67
- tintColor={colors.text}
68
- name={{ ios: 'arrow.up.right.square', web: 'link' }}
69
- size={12}
70
- />
71
- </Pressable>
72
- </ExternalLink>
73
- </ThemedView>
74
- </View>
75
- );
76
- }
77
-
78
- const styles = StyleSheet.create({
79
- tabListContainer: {
80
- position: 'absolute',
81
- width: '100%',
82
- padding: Spacing.three,
83
- justifyContent: 'center',
84
- alignItems: 'center',
85
- flexDirection: 'row',
86
- },
87
- innerContainer: {
88
- paddingVertical: Spacing.two,
89
- paddingHorizontal: Spacing.five,
90
- borderRadius: Spacing.five,
91
- flexDirection: 'row',
92
- alignItems: 'center',
93
- flexGrow: 1,
94
- gap: Spacing.two,
95
- maxWidth: MaxContentWidth,
96
- },
97
- brandText: {
98
- marginRight: 'auto',
99
- },
100
- pressed: {
101
- opacity: 0.7,
102
- },
103
- tabButtonView: {
104
- paddingVertical: Spacing.one,
105
- paddingHorizontal: Spacing.three,
106
- borderRadius: Spacing.three,
107
- },
108
- externalPressable: {
109
- flexDirection: 'row',
110
- justifyContent: 'center',
111
- alignItems: 'center',
112
- gap: Spacing.one,
113
- marginLeft: Spacing.three,
114
- },
115
- });
@@ -1,25 +0,0 @@
1
- import { Href, Link } from 'expo-router';
2
- import { openBrowserAsync, WebBrowserPresentationStyle } from 'expo-web-browser';
3
- import { type ComponentProps } from 'react';
4
-
5
- type Props = Omit<ComponentProps<typeof Link>, 'href'> & { href: Href & string };
6
-
7
- export function ExternalLink({ href, ...rest }: Props) {
8
- return (
9
- <Link
10
- target="_blank"
11
- {...rest}
12
- href={href}
13
- onPress={async (event) => {
14
- if (process.env.EXPO_OS !== 'web') {
15
- // Prevent the default behavior of linking to the default browser on native.
16
- event.preventDefault();
17
- // Open the link in an in-app browser.
18
- await openBrowserAsync(href, {
19
- presentationStyle: WebBrowserPresentationStyle.AUTOMATIC,
20
- });
21
- }
22
- }}
23
- />
24
- );
25
- }
@@ -1,35 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import { View, StyleSheet } from 'react-native';
3
-
4
- import { ThemedText } from './themed-text';
5
- import { ThemedView } from './themed-view';
6
-
7
- import { Spacing } from '@/constants/theme';
8
-
9
- type HintRowProps = {
10
- title?: string;
11
- hint?: ReactNode;
12
- };
13
-
14
- export function HintRow({ title = 'Try editing', hint = 'app/index.tsx' }: HintRowProps) {
15
- return (
16
- <View style={styles.stepRow}>
17
- <ThemedText type="small">{title}</ThemedText>
18
- <ThemedView type="backgroundSelected" style={styles.codeSnippet}>
19
- <ThemedText themeColor="textSecondary">{hint}</ThemedText>
20
- </ThemedView>
21
- </View>
22
- );
23
- }
24
-
25
- const styles = StyleSheet.create({
26
- stepRow: {
27
- flexDirection: 'row',
28
- justifyContent: 'space-between',
29
- },
30
- codeSnippet: {
31
- borderRadius: Spacing.two,
32
- paddingVertical: Spacing.half,
33
- paddingHorizontal: Spacing.two,
34
- },
35
- });