-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bdae65
commit ba4ebd5
Showing
16 changed files
with
3,078 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import { Link, Stack } from 'expo-router'; | ||
import { Text } from 'react-native'; | ||
import { Stack } from 'expo-router'; | ||
import { H1, View } from 'tamagui'; | ||
|
||
import { ThemedView } from '@/components/ThemedView'; | ||
import { LinkButton } from '@/components/Link'; | ||
|
||
export default function NotFoundScreen() { | ||
return ( | ||
<> | ||
<Stack.Screen options={{ title: 'Oops!' }} /> | ||
<ThemedView className="flex items-center justify-center p-5"> | ||
<Text>This screen doesn't exist.</Text> | ||
<Link href="/" className="mt-4 py-4"> | ||
Go to home screen! | ||
</Link> | ||
</ThemedView> | ||
<Stack.Screen options={{ headerShown: false }} /> | ||
<View | ||
display="flex" | ||
alignItems="center" | ||
justifyContent="center" | ||
gap="$6" | ||
minHeight="100vh" | ||
> | ||
<H1>页面不存在</H1> | ||
|
||
<LinkButton href="/" variant="outlined"> | ||
返回首页 | ||
</LinkButton> | ||
</View> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
import { Platform } from 'react-native'; | ||
import { Stack } from 'expo-router'; | ||
import { TamaguiProvider } from 'tamagui'; | ||
|
||
import '../global.css'; | ||
import tamaguiConfig from '../tamagui.config'; | ||
|
||
if (Platform.OS === 'web') { | ||
require('@tamagui/core/reset.css'); | ||
require('../tamagui-web.css'); | ||
} | ||
|
||
export default function RootLayout() { | ||
return ( | ||
<Stack> | ||
<Stack.Screen name="(tabs)" options={{ headerShown: false }} /> | ||
<Stack.Screen name="+not-found" /> | ||
</Stack> | ||
<TamaguiProvider config={tamaguiConfig}> | ||
<Stack> | ||
<Stack.Screen name="(tabs)" options={{ headerShown: false }} /> | ||
<Stack.Screen name="+not-found" /> | ||
</Stack> | ||
</TamaguiProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
module.exports = function (api) { | ||
api.cache(true); | ||
return { | ||
presets: [ | ||
['babel-preset-expo', { jsxImportSource: 'nativewind' }], | ||
'nativewind/babel', | ||
presets: [['babel-preset-expo', { jsxRuntime: 'automatic' }]], | ||
plugins: [ | ||
[ | ||
'@tamagui/babel-plugin', | ||
{ | ||
components: ['tamagui'], | ||
config: './tamagui.config.ts', | ||
logTimings: true, | ||
disableExtraction: process.env.NODE_ENV === 'development', | ||
}, | ||
], | ||
'react-native-reanimated/plugin', | ||
], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Link as RouterLink, type Href } from 'expo-router'; | ||
import { Button, styled, type ButtonProps, type GetProps } from 'tamagui'; | ||
|
||
export const Link = styled(RouterLink); | ||
|
||
export type LinkProps = GetProps<typeof Link>; | ||
|
||
export const LinkButton: React.FC< | ||
React.PropsWithChildren< | ||
Omit<ButtonProps, 'href' | 'hrefAttrs'> & { href: Href } | ||
> | ||
> = ({ href, children, ...props }) => ( | ||
<RouterLink href={href} asChild> | ||
<Button {...props}>{children}</Button> | ||
</RouterLink> | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
// Learn more https://docs.expo.io/guides/customizing-metro | ||
const { getDefaultConfig } = require('expo/metro-config'); | ||
const { withNativeWind } = require('nativewind/metro'); | ||
const { withTamagui } = require('@tamagui/metro-plugin'); | ||
|
||
/** @type {import('expo/metro-config').MetroConfig} */ | ||
const config = getDefaultConfig(__dirname); | ||
|
||
module.exports = withNativeWind(config, { | ||
input: './global.css', | ||
inlineRem: false, | ||
config.resolver.sourceExts.push('mjs') | ||
|
||
module.exports = withTamagui(config, { | ||
components: ['tamagui'], | ||
config: './tamagui.config.ts', | ||
outputCSS: './tamagui-web.css', | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.