Skip to content

Commit

Permalink
chore: resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
KatyH820 committed May 13, 2024
2 parents 0e4c644 + 2847472 commit f6ad323
Show file tree
Hide file tree
Showing 97 changed files with 12,911 additions and 15,535 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ env:
FORCE_COLOR: 3
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}

jobs:
test:
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ node_modules/

.expo

# Turborepo cookies
# .turbo
# Turborepo
**/*.cookie

# Logs.
*.log
.pnpm-debug.log*
**/*.log*


#####################################################################################
Expand Down
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node-linker=hoisted
public-hoist-pattern[]=*prisma*
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
10 changes: 5 additions & 5 deletions apps/expo/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ const defineConfig = (): ExpoConfig => ({
backgroundColor: "#1F104A",
},
},
// extra: {
// eas: {
// projectId: "your-eas-project-id",
// },
// },
extra: {
eas: {
projectId: "e5b5d2cd-098b-4fe4-85ed-ac05e395552d", // dennis' project id for now
},
},
experiments: {
tsconfigPaths: true,
typedRoutes: true,
Expand Down
4 changes: 2 additions & 2 deletions apps/expo/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ module.exports = function (api) {
components: ["tamagui"],
config: "./tamagui.config.ts",
logTimings: true,
disableExtraction: process.env.NODE_ENV === 'development'
disableExtraction: process.env.NODE_ENV === "development",
},
],
// NOTE: this is only necessary if you are using reanimated for animations
"react-native-reanimated/plugin",
],
};
}
};
4 changes: 1 addition & 3 deletions apps/expo/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ const { FileStore } = require("metro-cache");
const path = require("path");

module.exports = withTurborepoManagedCache(
withMonorepoPaths(
getDefaultConfig(__dirname),
),
withMonorepoPaths(getDefaultConfig(__dirname)),
);

/**
Expand Down
17 changes: 11 additions & 6 deletions apps/expo/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@zotmeal/expo_",
"name": "@zotmeal/expo",
"version": "0.1.0",
"private": true,
"main": "expo-router/entry",
Expand All @@ -16,22 +16,27 @@
},
"dependencies": {
"@expo/metro-config": "^0.17.6",
"@react-native-async-storage/async-storage": "1.21.0",
"@react-native-community/datetimepicker": "7.6.1",
"@react-native-picker/picker": "2.6.1",
"@react-navigation/drawer": "^6.6.11",
"@shopify/flash-list": "1.6.3",
"@tamagui/babel-plugin": "^1.94.3",
"@tamagui/config": "^1.94.3",
"@tamagui/lucide-icons": "^1.94.3",
"@tamagui/babel-plugin": "^1.94.4",
"@tamagui/config": "^1.94.4",
"@tamagui/lucide-icons": "^1.94.4",
"@tamagui/toast": "^1.94.4",
"@tanstack/react-query": "^5.25.0",
"@trpc/client": "11.0.0-rc.330",
"@trpc/react-query": "11.0.0-rc.330",
"@trpc/server": "11.0.0-rc.330",
"@zotmeal/api": "workspace:^",
"@zotmeal/db": "workspace:^",
"@zotmeal/utils": "workspace:^",
"burnt": "^0.12.2",
"expo": "~50.0.8",
"expo-constants": "~15.4.5",
"expo-font": "^11.10.3",
"expo-linear-gradient": "~12.7.2",
"expo-linking": "~6.2.2",
"expo-router": "~3.4.8",
"expo-splash-screen": "~0.26.4",
Expand All @@ -46,7 +51,7 @@
"react-native-screens": "~3.30.1",
"react-native-svg": "^15.1.0",
"superjson": "2.2.1",
"tamagui": "^1.94.3",
"tamagui": "^1.94.4",
"zustand": "^4.5.2"
},
"devDependencies": {
Expand Down Expand Up @@ -74,4 +79,4 @@
]
},
"prettier": "@zotmeal/prettier-config"
}
}
219 changes: 46 additions & 173 deletions apps/expo/src/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,144 +1,34 @@
import { config } from '@tamagui/config/v3';
import '@tamagui/core/reset.css';
import InterBold from "@tamagui/font-inter/otf/Inter-Bold.otf";
import Inter from "@tamagui/font-inter/otf/Inter-Medium.otf";
import { Menu } from '@tamagui/lucide-icons';
import { config } from "@tamagui/config/v3";

import "@tamagui/core/reset.css";

import type { FontSource } from "expo-font";
import { useColorScheme } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { useFonts } from "expo-font";
import { Link, Stack, useSegments } from "expo-router";
import type { Href } from "expo-router";
import { Stack } from "expo-router";
import { StatusBar } from "expo-status-bar";
import { useColorScheme } from "react-native";
import { Adapt, Button, H3, Image, Popover, Separator, TamaguiProvider, Theme, View, YGroup, createTamagui } from "tamagui";
import { TRPCProvider } from "~/utils/api";
// import { GestureHandlerRootView } from "react-native-gesture-handler";
// import { Drawer } from "expo-router/drawer";
import InterBold from "@tamagui/font-inter/otf/Inter-Bold.otf";
import Inter from "@tamagui/font-inter/otf/Inter-Medium.otf";
import { ToastProvider, ToastViewport } from "@tamagui/toast";
import { createTamagui, TamaguiProvider, Theme } from "tamagui";

import { HamburgerMenu, Logo } from "~/components";
import { TRPCProvider } from "~/utils";

// Main layout of the app
// It wraps your pages with the providers they need

const tamaguiConfig = createTamagui(config);

// TODO: linking should only push to stack when the screen isn't home
export function HamburgerMenu() {
const currentSegment = useSegments()[0] ?? "";
const screens: Record<string, Href<"pathname">> = {
"Home": "/",
"Events": "/events/",
"Settings": "/settings/",
"About": "/about/",
"Privacy Policy": "/privacy-policy/",
};

return (
<Popover placement="top">
<Popover.Trigger asChild>
<Button backgroundColor={0} padding={0}>
<Menu color="white" size="$2" />
</Button>
</Popover.Trigger>
<Adapt when={"sm" as unknown as undefined} platform="touch">
<Popover.Sheet modal dismissOnSnapToBottom snapPoints={[50]}>
<Popover.Sheet.Frame padding="$4">
<Adapt.Contents />
</Popover.Sheet.Frame>
<Popover.Sheet.Overlay
animation="quickest"
enterStyle={{ opacity: 0 }}
exitStyle={{ opacity: 0 }} />
</Popover.Sheet>
</Adapt>
<Popover.Content
borderWidth={1}
borderColor="$borderColor"
enterStyle={{ y: -10, opacity: 0 }}
exitStyle={{ y: -10, opacity: 0 }}
elevate
animation={[
'quickest',
{
opacity: {
overshootClamping: true,
},
},
]}
>
<YGroup separator={<Separator />}>
{Object
.entries(screens)
.map(([name, path]) => (
<YGroup.Item key={name}>
<Popover.Close asChild disabled={path.replaceAll("/", "") === currentSegment}>
<Link
replace
href={path}
asChild
disabled={path.replaceAll("/", "") === currentSegment}
>
<Button
size="$5"
fontWeight={"800"}
paddingHorizontal="$5"
borderRadius="$10"
disabled={path.replaceAll("/", "") === currentSegment}
disabledStyle={{
opacity: 0.3,
}}
>
{name}
</Button>
</Link>
</Popover.Close>
</YGroup.Item>
))}
<YGroup.Item>
<Popover.Close asChild>
<Button
size="$5"
fontWeight={"800"}
paddingHorizontal="$5"
borderRadius="$10"
>
Close
</Button>
</Popover.Close>
</YGroup.Item>
</YGroup>
</Popover.Content>
</Popover>
);
}

export const Logo = () => (
<View flexDirection="row">
<Image
resizeMode="contain"
alignSelf="center"
source={
{
width: 43,
height: 43,
// uri: "https://www.clipartmax.com/png/middle/432-4326703_uci-peter-the-anteater-sticker.png"
uri: "https://c.tenor.com/MBn4pz0PYgMAAAAd/tenor.gif"
}
}
/>
<H3
color="white"
fontWeight={"800"}
>
ZotMeal
</H3>
</View>
)

export default function RootLayout() {
const [loaded] = useFonts({
Inter: Inter as FontSource,
InterBold: InterBold as FontSource,
});

const colorScheme = useColorScheme();
const { bottom, left, right } = useSafeAreaInsets();

if (!loaded) {
return null;
Expand All @@ -147,55 +37,38 @@ export default function RootLayout() {
return (
<TRPCProvider>
<TamaguiProvider config={tamaguiConfig}>
<Theme name={colorScheme}>

{/* <GestureHandlerRootView style={{ flex: 1 }}>
<Drawer>
<Drawer.Screen
name="index"
options={{
drawerLabel: 'Home',
title: 'overview',
}}
/>
<Drawer.Screen
name="settings"
options={{
drawerLabel: 'Settings',
title: 'Settings',
}}
/>
<Drawer.Screen
name="about"
options={{
drawerLabel: 'About',
title: 'About',
}}
/>
<Drawer.Screen
name="privacy-policy"
options={{
drawerLabel: 'Privacy Policy',
title: 'Privacy Policy',
}}
/>
</Drawer>
</GestureHandlerRootView> */}
<Stack
screenOptions={{
headerTitle: () => <Logo />,
headerRight: () => <HamburgerMenu />,
headerStyle: {
backgroundColor: "#1A1B1D",
},
contentStyle: {
backgroundColor: colorScheme === "dark" ? "#1A1B1D" : "#FFFFFF",
},
}}
<ToastProvider>
<Theme name={colorScheme}>
<Stack
screenOptions={{
headerTitle: () => <Logo />,
headerRight: () => <HamburgerMenu />,
headerStyle: {
backgroundColor: "#1A1B1D",
},
contentStyle: {
backgroundColor:
colorScheme === "dark" ? "#1A1B1D" : "#FFFFFF",
},
}}
>
{/* <Stack.Screen
name="events"
options={{
presentation: "modal",
}}
/> */}
</Stack>
<StatusBar style="light" />
</Theme>
<ToastViewport
flexDirection="column"
bottom={bottom}
left={left}
right={right}
/>
<StatusBar />
</Theme>
</ToastProvider>
</TamaguiProvider>
</TRPCProvider>
)
);
}
4 changes: 1 addition & 3 deletions apps/expo/src/app/about/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Text } from "tamagui";

export default function About() {
return (
<Text>About</Text>
);
return <Text>About</Text>;
}
Loading

0 comments on commit f6ad323

Please sign in to comment.