Skip to content

Commit be34705

Browse files
committedNov 18, 2024
Initial commit
Generated by create-expo-stack 2.11.25
0 parents  commit be34705

29 files changed

+16197
-0
lines changed
 

‎.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
node_modules/
2+
.expo/
3+
dist/
4+
npm-debug.*
5+
*.jks
6+
*.p8
7+
*.p12
8+
*.key
9+
*.mobileprovision
10+
*.orig.*
11+
web-build/
12+
# expo router
13+
expo-env.d.ts
14+
15+
16+
17+
ios
18+
android
19+
20+
# macOS
21+
.DS_Store
22+
23+
# Temporary files created by Metro to check the health of the file watcher
24+
.metro-health-check*

‎app-env.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// @ts-ignore
2+
/// <reference types="nativewind/types" />

‎app.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"expo": {
3+
"name": "ChefBuddy",
4+
"slug": "ChefBuddy",
5+
"version": "1.0.0",
6+
7+
"scheme": "ChefBuddy",
8+
"web": {
9+
"bundler": "metro",
10+
"output": "static",
11+
"favicon": "./assets/favicon.png"
12+
},
13+
"plugins": ["expo-router"],
14+
"experiments": {
15+
"typedRoutes": true,
16+
17+
"tsconfigPaths": true
18+
},
19+
20+
"orientation": "portrait",
21+
"icon": "./assets/icon.png",
22+
23+
"userInterfaceStyle": "light",
24+
25+
"splash": {
26+
"image": "./assets/splash.png",
27+
"resizeMode": "contain",
28+
"backgroundColor": "#ffffff"
29+
},
30+
"assetBundlePatterns": ["**/*"],
31+
"ios": {
32+
"supportsTablet": true
33+
},
34+
"android": {
35+
"adaptiveIcon": {
36+
"foregroundImage": "./assets/adaptive-icon.png",
37+
"backgroundColor": "#ffffff"
38+
}
39+
}
40+
}
41+
}

‎app/(tabs)/_layout.tsx

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Link, Tabs } from 'expo-router';
2+
3+
import { HeaderButton } from '../../components/HeaderButton';
4+
import { TabBarIcon } from '../../components/TabBarIcon';
5+
6+
export default function TabLayout() {
7+
return (
8+
<Tabs
9+
screenOptions={{
10+
tabBarActiveTintColor: 'black',
11+
}}>
12+
<Tabs.Screen
13+
name="index"
14+
options={{
15+
title: 'Tab One',
16+
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
17+
headerRight: () => (
18+
<Link href="/modal" asChild>
19+
<HeaderButton />
20+
</Link>
21+
),
22+
}}
23+
/>
24+
<Tabs.Screen
25+
name="two"
26+
options={{
27+
title: 'Tab Two',
28+
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
29+
}}
30+
/>
31+
</Tabs>
32+
);
33+
}

‎app/(tabs)/index.tsx

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Stack } from 'expo-router';
2+
import { StyleSheet, View } from 'react-native';
3+
4+
import { ScreenContent } from '~/components/ScreenContent';
5+
6+
export default function Home() {
7+
return (
8+
<>
9+
<Stack.Screen options={{ title: 'Tab One' }} />
10+
<View style={styles.container}>
11+
<ScreenContent path="app/(tabs)/index.tsx" title="Tab One" />
12+
</View>
13+
</>
14+
);
15+
}
16+
17+
const styles = StyleSheet.create({
18+
container: {
19+
flex: 1,
20+
padding: 24,
21+
},
22+
});

‎app/(tabs)/two.tsx

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Stack } from 'expo-router';
2+
import { StyleSheet, View } from 'react-native';
3+
4+
import { ScreenContent } from '~/components/ScreenContent';
5+
6+
export default function Home() {
7+
return (
8+
<>
9+
<Stack.Screen options={{ title: 'Tab Two' }} />
10+
<View style={styles.container}>
11+
<ScreenContent path="app/(tabs)/two.tsx" title="Tab Two" />
12+
</View>
13+
</>
14+
);
15+
}
16+
17+
const styles = StyleSheet.create({
18+
container: {
19+
flex: 1,
20+
padding: 24,
21+
},
22+
});

‎app/+html.tsx

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { ScrollViewStyleReset } from 'expo-router/html';
2+
3+
// This file is web-only and used to configure the root HTML for every
4+
// web page during static rendering.
5+
// The contents of this function only run in Node.js environments and
6+
// do not have access to the DOM or browser APIs.
7+
export default function Root({ children }: { children: React.ReactNode }) {
8+
return (
9+
<html lang="en">
10+
<head>
11+
<meta charSet="utf-8" />
12+
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
13+
14+
{/*
15+
This viewport disables scaling which makes the mobile website act more like a native app.
16+
However this does reduce built-in accessibility. If you want to enable scaling, use this instead:
17+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
18+
*/}
19+
<meta
20+
name="viewport"
21+
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1.00001,viewport-fit=cover"
22+
/>
23+
{/*
24+
Disable body scrolling on web. This makes ScrollView components work closer to how they do on native.
25+
However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line.
26+
*/}
27+
<ScrollViewStyleReset />
28+
29+
{/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */}
30+
<style dangerouslySetInnerHTML={{ __html: responsiveBackground }} />
31+
{/* Add any additional <head> elements that you want globally available on web... */}
32+
</head>
33+
<body>{children}</body>
34+
</html>
35+
);
36+
}
37+
38+
const responsiveBackground = `
39+
body {
40+
background-color: #fff;
41+
}
42+
@media (prefers-color-scheme: dark) {
43+
body {
44+
background-color: #000;
45+
}
46+
}`;

‎app/+not-found.tsx

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Link, Stack } from 'expo-router';
2+
import { Text, View } from 'react-native';
3+
4+
export default function NotFoundScreen() {
5+
return (
6+
<>
7+
<Stack.Screen options={{ title: 'Oops!' }} />
8+
<View className={styles.container}>
9+
<Text className={styles.title}>This screen doesn't exist.</Text>
10+
<Link href="/" className={styles.link}>
11+
<Text className={styles.linkText}>Go to home screen!</Text>
12+
</Link>
13+
</View>
14+
</>
15+
);
16+
}
17+
18+
const styles = {
19+
container: `items-center flex-1 justify-center p-5`,
20+
title: `text-xl font-bold`,
21+
link: `mt-4 pt-4`,
22+
linkText: `text-base text-[#2e78b7]`,
23+
};

‎app/_layout.tsx

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import '../global.css';
2+
3+
import { Stack } from 'expo-router';
4+
5+
export const unstable_settings = {
6+
// Ensure that reloading on `/modal` keeps a back button present.
7+
initialRouteName: '(tabs)',
8+
};
9+
10+
export default function RootLayout() {
11+
return (
12+
<Stack>
13+
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
14+
<Stack.Screen name="modal" options={{ presentation: 'modal' }} />
15+
</Stack>
16+
);
17+
}

‎app/modal.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { StatusBar } from 'expo-status-bar';
2+
import { Platform } from 'react-native';
3+
4+
import { ScreenContent } from '~/components/ScreenContent';
5+
6+
export default function Modal() {
7+
return (
8+
<>
9+
<ScreenContent path="app/modal.tsx" title="Modal" />
10+
<StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
11+
</>
12+
);
13+
}

‎assets/adaptive-icon.png

17.1 KB
Loading

‎assets/favicon.png

1.43 KB
Loading

‎assets/icon.png

21.9 KB
Loading

‎assets/splash.png

46.2 KB
Loading

‎babel.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = function (api) {
2+
api.cache(true);
3+
const plugins = [];
4+
5+
return {
6+
presets: [['babel-preset-expo', { jsxImportSource: 'nativewind' }], 'nativewind/babel'],
7+
8+
plugins,
9+
};
10+
};

‎cesconfig.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"cesVersion": "2.11.25",
3+
"projectName": "ChefBuddy",
4+
"packages": [
5+
{
6+
"name": "expo-router",
7+
"type": "navigation",
8+
"options": {
9+
"type": "tabs"
10+
}
11+
},
12+
{
13+
"name": "nativewind",
14+
"type": "styling"
15+
}
16+
],
17+
"flags": {
18+
"noGit": false,
19+
"noInstall": false,
20+
"overwrite": false,
21+
"importAlias": true,
22+
"packageManager": "npm",
23+
"eas": false
24+
},
25+
"packageManager": {
26+
"type": "npm",
27+
"version": "10.9.0"
28+
},
29+
"os": {
30+
"type": "Darwin",
31+
"platform": "darwin",
32+
"arch": "arm64",
33+
"kernelVersion": "24.0.0"
34+
}
35+
}

‎components/Button.tsx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { forwardRef } from 'react';
2+
import { Text, TouchableOpacity, TouchableOpacityProps } from 'react-native';
3+
4+
type ButtonProps = {
5+
title: string;
6+
} & TouchableOpacityProps;
7+
8+
export const Button = forwardRef<TouchableOpacity, ButtonProps>(
9+
({ title, ...touchableProps }, ref) => {
10+
return (
11+
<TouchableOpacity
12+
ref={ref}
13+
{...touchableProps}
14+
className={`${styles.button} ${touchableProps.className}`}>
15+
<Text className={styles.buttonText}>{title}</Text>
16+
</TouchableOpacity>
17+
);
18+
}
19+
);
20+
21+
const styles = {
22+
button: 'items-center bg-indigo-500 rounded-[28px] shadow-md p-4',
23+
buttonText: 'text-white text-lg font-semibold text-center',
24+
};

‎components/Container.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { SafeAreaView } from 'react-native';
2+
3+
export const Container = ({ children }: { children: React.ReactNode }) => {
4+
return <SafeAreaView className={styles.container}>{children}</SafeAreaView>;
5+
};
6+
7+
const styles = {
8+
container: 'flex flex-1 m-6',
9+
};

‎components/EditScreenInfo.tsx

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { Text, View } from 'react-native';
2+
3+
export const EditScreenInfo = ({ path }: { path: string }) => {
4+
const title = 'Open up the code for this screen:';
5+
const description =
6+
'Change any of the text, save the file, and your app will automatically update.';
7+
8+
return (
9+
<View>
10+
<View className={styles.getStartedContainer}>
11+
<Text className={styles.getStartedText}>{title}</Text>
12+
<View className={styles.codeHighlightContainer + styles.homeScreenFilename}>
13+
<Text>{path}</Text>
14+
</View>
15+
<Text className={styles.getStartedText}>{description}</Text>
16+
</View>
17+
</View>
18+
);
19+
};
20+
21+
const styles = {
22+
codeHighlightContainer: `rounded-md px-1`,
23+
getStartedContainer: `items-center mx-12`,
24+
getStartedText: `text-lg leading-6 text-center`,
25+
helpContainer: `items-center mx-5 mt-4`,
26+
helpLink: `py-4`,
27+
helpLinkText: `text-center`,
28+
homeScreenFilename: `my-2`,
29+
};

‎components/HeaderButton.tsx

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import FontAwesome from '@expo/vector-icons/FontAwesome';
2+
import { forwardRef } from 'react';
3+
import { Pressable, StyleSheet } from 'react-native';
4+
5+
export const HeaderButton = forwardRef<typeof Pressable, { onPress?: () => void }>(
6+
({ onPress }, ref) => {
7+
return (
8+
<Pressable onPress={onPress}>
9+
{({ pressed }) => (
10+
<FontAwesome
11+
name="info-circle"
12+
size={25}
13+
color="gray"
14+
style={[
15+
styles.headerRight,
16+
{
17+
opacity: pressed ? 0.5 : 1,
18+
},
19+
]}
20+
/>
21+
)}
22+
</Pressable>
23+
);
24+
}
25+
);
26+
27+
export const styles = StyleSheet.create({
28+
headerRight: {
29+
marginRight: 15,
30+
},
31+
});

‎components/ScreenContent.tsx

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Text, View } from 'react-native';
2+
3+
import { EditScreenInfo } from './EditScreenInfo';
4+
5+
type ScreenContentProps = {
6+
title: string;
7+
path: string;
8+
children?: React.ReactNode;
9+
};
10+
11+
export const ScreenContent = ({ title, path, children }: ScreenContentProps) => {
12+
return (
13+
<View className={styles.container}>
14+
<Text className={styles.title}>{title}</Text>
15+
<View className={styles.separator} />
16+
<EditScreenInfo path={path} />
17+
{children}
18+
</View>
19+
);
20+
};
21+
const styles = {
22+
container: `items-center flex-1 justify-center`,
23+
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
24+
title: `text-xl font-bold`,
25+
};

‎components/TabBarIcon.tsx

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import FontAwesome from '@expo/vector-icons/FontAwesome';
2+
import { StyleSheet } from 'react-native';
3+
4+
export const TabBarIcon = (props: {
5+
name: React.ComponentProps<typeof FontAwesome>['name'];
6+
color: string;
7+
}) => {
8+
return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
9+
};
10+
11+
export const styles = StyleSheet.create({
12+
tabBarIcon: {
13+
marginBottom: -3,
14+
},
15+
});

‎global.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

‎metro.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Learn more https://docs.expo.io/guides/customizing-metro
2+
const { getDefaultConfig } = require('expo/metro-config');
3+
const { withNativeWind } = require('nativewind/metro');
4+
5+
/** @type {import('expo/metro-config').MetroConfig} */
6+
// eslint-disable-next-line no-undef
7+
const config = getDefaultConfig(__dirname);
8+
9+
module.exports = withNativeWind(config, { input: './global.css' });

‎package-lock.json

+15,674
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "ChefBuddy",
3+
"version": "1.0.0",
4+
"main": "expo-router/entry",
5+
"scripts": {
6+
"android": "expo start --android",
7+
"ios": "expo start --ios",
8+
"start": "expo start",
9+
"prebuild": "expo prebuild",
10+
"lint": "eslint \"**/*.{js,jsx,ts,tsx}\" && prettier -c \"**/*.{js,jsx,ts,tsx,json}\"",
11+
"format": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix && prettier \"**/*.{js,jsx,ts,tsx,json}\" --write",
12+
"web": "expo start --web"
13+
},
14+
"dependencies": {
15+
"@expo/vector-icons": "^14.0.0",
16+
"@react-navigation/native": "^6.1.7",
17+
"expo": "^52.0.7",
18+
"expo-constants": "~17.0.3",
19+
"expo-linking": "~7.0.2",
20+
"expo-router": "~4.0.6",
21+
"expo-status-bar": "~2.0.0",
22+
"expo-system-ui": "~4.0.3",
23+
"expo-web-browser": "~14.0.1",
24+
"nativewind": "latest",
25+
"react": "18.3.1",
26+
"react-dom": "18.3.1",
27+
"react-native": "0.76.2",
28+
"react-native-gesture-handler": "~2.20.2",
29+
"react-native-reanimated": "~3.16.1",
30+
"react-native-safe-area-context": "4.10.1",
31+
"react-native-screens": "~4.1.0",
32+
"react-native-web": "~0.19.10"
33+
},
34+
"devDependencies": {
35+
"@babel/core": "^7.20.0",
36+
"@types/react": "~18.3.12",
37+
"@typescript-eslint/eslint-plugin": "^7.7.0",
38+
"@typescript-eslint/parser": "^7.7.0",
39+
"eslint": "^8.57.0",
40+
"eslint-config-universe": "^12.0.1",
41+
"prettier": "^3.2.5",
42+
"prettier-plugin-tailwindcss": "^0.5.11",
43+
"tailwindcss": "^3.4.0",
44+
"typescript": "~5.3.3"
45+
},
46+
"eslintConfig": {
47+
"extends": "universe/native",
48+
"root": true
49+
},
50+
"expo": {
51+
"install": {
52+
"exclude": [
53+
"react-native-safe-area-context"
54+
]
55+
}
56+
},
57+
"private": true
58+
}

‎prettier.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
printWidth: 100,
3+
tabWidth: 2,
4+
singleQuote: true,
5+
bracketSameLine: true,
6+
trailingComma: 'es5',
7+
8+
plugins: [require.resolve('prettier-plugin-tailwindcss')],
9+
tailwindAttributes: ['className'],
10+
};

‎tailwind.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/** @type {import('tailwindcss').Config} */
2+
module.exports = {
3+
content: ['./app/**/*.{js,ts,tsx}', './components/**/*.{js,ts,tsx}'],
4+
5+
presets: [require('nativewind/preset')],
6+
theme: {
7+
extend: {},
8+
},
9+
plugins: [],
10+
};

‎tsconfig.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "expo/tsconfig.base",
3+
"compilerOptions": {
4+
"strict": true,
5+
6+
"baseUrl": ".",
7+
"paths": {
8+
"~/*": ["*"]
9+
}
10+
},
11+
"include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"]
12+
}

0 commit comments

Comments
 (0)
Please sign in to comment.