diff --git a/.github/workflows/expo.build.yml b/.github/workflows/expo.build.yml index db3a80486..f8f291f01 100644 --- a/.github/workflows/expo.build.yml +++ b/.github/workflows/expo.build.yml @@ -46,9 +46,9 @@ jobs: # If you need additional setup or configurations, add them here - name: Run Local Build for Android - working-directory: ./client + working-directory: ./apps/expo run: eas build --non-interactive --platform android --local - name: Run Local Build for iOS - working-directory: ./client + working-directory: ./apps/expo run: eas build --non-interactive --platform ios --local \ No newline at end of file diff --git a/.github/workflows/node.js.dev.yml b/.github/workflows/node.js.dev.yml index d52256ed6..de347340f 100644 --- a/.github/workflows/node.js.dev.yml +++ b/.github/workflows/node.js.dev.yml @@ -73,9 +73,9 @@ jobs: cd server yarn start & - - name: Start Client in Background + - name: Start Expo in Background run: | - cd client + cd apps/expo yarn web & - name: Wait for a while diff --git a/README.md b/README.md index 5cb3cc4eb..8dab05f74 100644 --- a/README.md +++ b/README.md @@ -107,14 +107,27 @@ The main apps are: - `packages` shared packages across apps - `ui` includes your custom UI kit that will be optimized by Tamagui - `app` you'll be importing most files from `app/` - - `features` (don't use a `screens` folder. organize by feature.) + - `features` (don't use a `screens` folder. organize by feature.) [pending] - `provider` (all the providers that wrap the app, and some no-ops for Web.) + - `api` - intended to be our services, but tRPC eliminated a lot of this need due to custom hooks. [mostly deprecated] + - `assets` - images and branding + - `auth` - auth provider and hook, currently set up for expo router auth. Once we have next js config done, will refactor to support next js auth somehow + - `components` - built components from our primitive ui elements (root/packages/ui), and custom logic hooks (/hooks) + - `config` - axios config, we have almost no axios needs with trpc. Once fully migrated away this will be removed. + - `constants` - strings and arrays that donโ€™t change + - `context` - all react context stuff + - `hooks` - custom hooks for logic and data fetching with trpc + - `media` - media query in react native config + - `public` - web only assets like favicon +/store - redux store. TRPC query reduced the need for a lot of these files. Will likely clean up soon. +/theme - tracks dark and light mode theming logic and tamagui config +/utils - utility functions that can be reused ## UI Kit Note we're following the [design systems guide](https://tamagui.dev/docs/guides/design-systems) and creating our own package for components. -See `packages/ui` named `@my/ui` for how this works. +See `packages/ui` named `@packrat/ui` for how this works. ## ๐Ÿ†• Add new dependencies @@ -186,7 +199,7 @@ cd PackRat 3. Set up the environment variables for the client and server. - If you have access to the development env files, use those. Otherwise, replace the values with your own. - - See the `.env.example` files in the `client` and `server` directories for the necessary environment variables. + - See the `.env.example` files in the `apps/expo` and `server` directories for the necessary environment variables. #### Automated Setup ๐Ÿ› ๏ธ @@ -199,10 +212,10 @@ yarn setup 1. Navigate to the `PackRat` directory if you are not already there. -2. Navigate to the `client` directory. +2. Navigate to the `apps/expo` directory. ``` -cd client +cd apps/expo ``` - Note that for the client to run, you need to also make the following changes: diff --git a/client/.eslintrc.js b/apps/expo/.eslintrc.js similarity index 100% rename from client/.eslintrc.js rename to apps/expo/.eslintrc.js diff --git a/client/.gitignore b/apps/expo/.gitignore similarity index 100% rename from client/.gitignore rename to apps/expo/.gitignore diff --git a/client/Dockerfile b/apps/expo/Dockerfile similarity index 100% rename from client/Dockerfile rename to apps/expo/Dockerfile diff --git a/client/Podfile.example b/apps/expo/Podfile.example similarity index 100% rename from client/Podfile.example rename to apps/expo/Podfile.example diff --git a/client/android/.gitignore b/apps/expo/android/.gitignore similarity index 100% rename from client/android/.gitignore rename to apps/expo/android/.gitignore diff --git a/client/android/app/build.gradle b/apps/expo/android/app/build.gradle similarity index 100% rename from client/android/app/build.gradle rename to apps/expo/android/app/build.gradle diff --git a/client/android/app/debug.keystore b/apps/expo/android/app/debug.keystore similarity index 100% rename from client/android/app/debug.keystore rename to apps/expo/android/app/debug.keystore diff --git a/client/android/app/proguard-rules.pro b/apps/expo/android/app/proguard-rules.pro similarity index 100% rename from client/android/app/proguard-rules.pro rename to apps/expo/android/app/proguard-rules.pro diff --git a/client/android/app/src/debug/AndroidManifest.xml b/apps/expo/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from client/android/app/src/debug/AndroidManifest.xml rename to apps/expo/android/app/src/debug/AndroidManifest.xml diff --git a/client/android/app/src/debug/java/com/andrewbierman/packrat/ReactNativeFlipper.java b/apps/expo/android/app/src/debug/java/com/andrewbierman/packrat/ReactNativeFlipper.java similarity index 100% rename from client/android/app/src/debug/java/com/andrewbierman/packrat/ReactNativeFlipper.java rename to apps/expo/android/app/src/debug/java/com/andrewbierman/packrat/ReactNativeFlipper.java diff --git a/client/android/app/src/main/AndroidManifest.xml b/apps/expo/android/app/src/main/AndroidManifest.xml similarity index 100% rename from client/android/app/src/main/AndroidManifest.xml rename to apps/expo/android/app/src/main/AndroidManifest.xml diff --git a/client/android/app/src/main/java/com/andrewbierman/packrat/MainActivity.java b/apps/expo/android/app/src/main/java/com/andrewbierman/packrat/MainActivity.java similarity index 100% rename from client/android/app/src/main/java/com/andrewbierman/packrat/MainActivity.java rename to apps/expo/android/app/src/main/java/com/andrewbierman/packrat/MainActivity.java diff --git a/client/android/app/src/main/java/com/andrewbierman/packrat/MainApplication.java b/apps/expo/android/app/src/main/java/com/andrewbierman/packrat/MainApplication.java similarity index 100% rename from client/android/app/src/main/java/com/andrewbierman/packrat/MainApplication.java rename to apps/expo/android/app/src/main/java/com/andrewbierman/packrat/MainApplication.java diff --git a/client/android/app/src/main/res/drawable-hdpi/splashscreen_image.png b/apps/expo/android/app/src/main/res/drawable-hdpi/splashscreen_image.png similarity index 100% rename from client/android/app/src/main/res/drawable-hdpi/splashscreen_image.png rename to apps/expo/android/app/src/main/res/drawable-hdpi/splashscreen_image.png diff --git a/client/android/app/src/main/res/drawable-mdpi/splashscreen_image.png b/apps/expo/android/app/src/main/res/drawable-mdpi/splashscreen_image.png similarity index 100% rename from client/android/app/src/main/res/drawable-mdpi/splashscreen_image.png rename to apps/expo/android/app/src/main/res/drawable-mdpi/splashscreen_image.png diff --git a/client/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png b/apps/expo/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png similarity index 100% rename from client/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png rename to apps/expo/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png diff --git a/client/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png b/apps/expo/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png similarity index 100% rename from client/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png rename to apps/expo/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png diff --git a/client/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png b/apps/expo/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png similarity index 100% rename from client/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png rename to apps/expo/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png diff --git a/client/android/app/src/main/res/drawable/rn_edit_text_material.xml b/apps/expo/android/app/src/main/res/drawable/rn_edit_text_material.xml similarity index 100% rename from client/android/app/src/main/res/drawable/rn_edit_text_material.xml rename to apps/expo/android/app/src/main/res/drawable/rn_edit_text_material.xml diff --git a/client/android/app/src/main/res/drawable/splashscreen.xml b/apps/expo/android/app/src/main/res/drawable/splashscreen.xml similarity index 100% rename from client/android/app/src/main/res/drawable/splashscreen.xml rename to apps/expo/android/app/src/main/res/drawable/splashscreen.xml diff --git a/client/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/apps/expo/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from client/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to apps/expo/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/client/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/apps/expo/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from client/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to apps/expo/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/client/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/expo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from client/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to apps/expo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/client/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/apps/expo/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png similarity index 100% rename from client/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png rename to apps/expo/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png diff --git a/client/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/apps/expo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from client/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to apps/expo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/client/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/expo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from client/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to apps/expo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/client/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/apps/expo/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png similarity index 100% rename from client/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png rename to apps/expo/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png diff --git a/client/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/apps/expo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from client/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to apps/expo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/client/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/expo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from client/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to apps/expo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/client/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/apps/expo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png similarity index 100% rename from client/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png rename to apps/expo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png diff --git a/client/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/apps/expo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from client/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to apps/expo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/expo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to apps/expo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/apps/expo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png similarity index 100% rename from client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png rename to apps/expo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png diff --git a/client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/apps/expo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to apps/expo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/expo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to apps/expo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/apps/expo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png similarity index 100% rename from client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png rename to apps/expo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png diff --git a/client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/apps/expo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to apps/expo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/client/android/app/src/main/res/values-night/colors.xml b/apps/expo/android/app/src/main/res/values-night/colors.xml similarity index 100% rename from client/android/app/src/main/res/values-night/colors.xml rename to apps/expo/android/app/src/main/res/values-night/colors.xml diff --git a/client/android/app/src/main/res/values/colors.xml b/apps/expo/android/app/src/main/res/values/colors.xml similarity index 100% rename from client/android/app/src/main/res/values/colors.xml rename to apps/expo/android/app/src/main/res/values/colors.xml diff --git a/client/android/app/src/main/res/values/strings.xml b/apps/expo/android/app/src/main/res/values/strings.xml similarity index 100% rename from client/android/app/src/main/res/values/strings.xml rename to apps/expo/android/app/src/main/res/values/strings.xml diff --git a/client/android/app/src/main/res/values/styles.xml b/apps/expo/android/app/src/main/res/values/styles.xml similarity index 100% rename from client/android/app/src/main/res/values/styles.xml rename to apps/expo/android/app/src/main/res/values/styles.xml diff --git a/client/android/app/src/release/java/com/andrewbierman/packrat/ReactNativeFlipper.java b/apps/expo/android/app/src/release/java/com/andrewbierman/packrat/ReactNativeFlipper.java similarity index 100% rename from client/android/app/src/release/java/com/andrewbierman/packrat/ReactNativeFlipper.java rename to apps/expo/android/app/src/release/java/com/andrewbierman/packrat/ReactNativeFlipper.java diff --git a/client/android/build.gradle b/apps/expo/android/build.gradle similarity index 100% rename from client/android/build.gradle rename to apps/expo/android/build.gradle diff --git a/client/android/gradle/wrapper/gradle-wrapper.jar b/apps/expo/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from client/android/gradle/wrapper/gradle-wrapper.jar rename to apps/expo/android/gradle/wrapper/gradle-wrapper.jar diff --git a/client/android/gradle/wrapper/gradle-wrapper.properties b/apps/expo/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from client/android/gradle/wrapper/gradle-wrapper.properties rename to apps/expo/android/gradle/wrapper/gradle-wrapper.properties diff --git a/client/android/gradlew b/apps/expo/android/gradlew similarity index 100% rename from client/android/gradlew rename to apps/expo/android/gradlew diff --git a/client/android/gradlew.bat b/apps/expo/android/gradlew.bat similarity index 100% rename from client/android/gradlew.bat rename to apps/expo/android/gradlew.bat diff --git a/client/android/settings.gradle b/apps/expo/android/settings.gradle similarity index 100% rename from client/android/settings.gradle rename to apps/expo/android/settings.gradle diff --git a/client/app.example.json b/apps/expo/app.example.json similarity index 100% rename from client/app.example.json rename to apps/expo/app.example.json diff --git a/client/app/(app)/_layout.tsx b/apps/expo/app/(app)/_layout.tsx similarity index 70% rename from client/app/(app)/_layout.tsx rename to apps/expo/app/(app)/_layout.tsx index 0d5d7448c..408b96ca9 100644 --- a/client/app/(app)/_layout.tsx +++ b/apps/expo/app/(app)/_layout.tsx @@ -1,5 +1,5 @@ import { Stack } from 'expo-router'; -import { useProtectedRoute, useSession } from '../../context/auth'; +import { useProtectedRoute, useSession } from 'app/context/auth'; export default function AppLayout() { const { session } = useSession(); diff --git a/client/app/(app)/about/index.tsx b/apps/expo/app/(app)/about/index.tsx similarity index 95% rename from client/app/(app)/about/index.tsx rename to apps/expo/app/(app)/about/index.tsx index de5f9e826..25c02fc2b 100644 --- a/client/app/(app)/about/index.tsx +++ b/apps/expo/app/(app)/about/index.tsx @@ -1,4 +1,4 @@ -import About from '../../../screens/about'; +import About from 'app/screens/about'; import { Platform, ScrollView, StyleSheet } from 'react-native'; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; diff --git a/client/app/(app)/appearance/index.tsx b/apps/expo/app/(app)/appearance/index.tsx similarity index 89% rename from client/app/(app)/appearance/index.tsx rename to apps/expo/app/(app)/appearance/index.tsx index 318afd02f..662cb1903 100644 --- a/client/app/(app)/appearance/index.tsx +++ b/apps/expo/app/(app)/appearance/index.tsx @@ -1,7 +1,7 @@ import { Platform } from 'react-native'; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; -import AppearanceContainer from '../../../screens/appearance/AppearanceContainer'; +import AppearanceContainer from 'app/screens/appearance/AppearanceContainer'; export default function Appearance() { return ( diff --git a/client/app/(app)/destination/[destinationId].tsx b/apps/expo/app/(app)/destination/[destinationId].tsx similarity index 92% rename from client/app/(app)/destination/[destinationId].tsx rename to apps/expo/app/(app)/destination/[destinationId].tsx index 81f1c57e7..9d698a380 100644 --- a/client/app/(app)/destination/[destinationId].tsx +++ b/apps/expo/app/(app)/destination/[destinationId].tsx @@ -1,5 +1,5 @@ import { Platform } from 'react-native'; -import { DestinationPage } from '../../../components/destination'; +import { DestinationPage } from 'app/components/destination'; // import DestinationPage from "../../components/destination"; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; diff --git a/client/app/(app)/drawer/index.tsx b/apps/expo/app/(app)/drawer/index.tsx similarity index 95% rename from client/app/(app)/drawer/index.tsx rename to apps/expo/app/(app)/drawer/index.tsx index 80383133f..3d5d6c294 100644 --- a/client/app/(app)/drawer/index.tsx +++ b/apps/expo/app/(app)/drawer/index.tsx @@ -7,14 +7,14 @@ import { MaterialCommunityIcons, MaterialIcons, } from '@expo/vector-icons'; -import { theme, darkTheme } from '../../../theme'; +import { theme, darkTheme } from 'app/theme'; // import { useAuth } from "../../auth/provider"; -import useTheme from '../../../hooks/useTheme'; -import { signOut } from '../../../store/authStore'; +import useTheme from 'app/hooks/useTheme'; +import { signOut } from 'app/store/authStore'; import { useDispatch, useSelector } from 'react-redux'; -import { useSession } from '../../../context/auth'; -import useCustomStyles from '~/hooks/useCustomStyles'; +import { useSession } from 'app/context/auth'; +import useCustomStyles from 'app/hooks/useCustomStyles'; export default function Drawer() { const { enableDarkMode, enableLightMode, isDark, isLight, currentTheme } = diff --git a/client/app/(app)/feed/index.tsx b/apps/expo/app/(app)/feed/index.tsx similarity index 93% rename from client/app/(app)/feed/index.tsx rename to apps/expo/app/(app)/feed/index.tsx index 0088e8d86..74cfdcff4 100644 --- a/client/app/(app)/feed/index.tsx +++ b/apps/expo/app/(app)/feed/index.tsx @@ -1,4 +1,4 @@ -import Feed from '../../../screens/feed/Feed'; +import Feed from 'app/screens/feed/Feed'; import { Platform } from 'react-native'; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; diff --git a/apps/expo/app/(app)/items/index.tsx b/apps/expo/app/(app)/items/index.tsx new file mode 100644 index 000000000..380794dc1 --- /dev/null +++ b/apps/expo/app/(app)/items/index.tsx @@ -0,0 +1,123 @@ +import { View } from 'react-native'; +import React, { useEffect, useState } from 'react'; +import { StyleSheet, Platform } from 'react-native'; +import { MaterialIcons } from '@expo/vector-icons'; +import { theme } from 'app/theme'; +import useTheme from 'app/hooks/useTheme'; +import { RTooltip, RButton, RScrollView, BaseModal } from '@packrat/ui'; +import { AddItemGlobal } from 'app/components/item/AddItemGlobal'; +import { ItemsTable } from 'app/components/itemtable/itemTable'; +import { useDispatch, useSelector } from 'react-redux'; +import { getItemsGlobal } from 'app/store/globalItemsStore'; +import { Stack } from 'expo-router'; +import Head from 'expo-router/head'; +import { useFetchGlobalItems } from 'app/hooks/globalItems'; +import useCustomStyles from 'app/hooks/useCustomStyles'; + +export default function Items() { + // pagination index limit + const [limit, setLimit] = useState(5); + // page number for pagination + const [page, setPage] = useState(1); + + const [refetch, setRefetch] = useState(false); + + const { data, isLoading, isError } = useFetchGlobalItems(limit, page); + return ( + + {Platform.OS === 'web' && ( + + Items + + )} + + + <> + } + > + + + + {!isError && + data?.globalItems && + Array.isArray(data?.globalItems?.items) ? ( + + ) : null} + + + ); +} +const loadStyles = () => { + const currentTheme = theme; + return { + container: { + display: 'flex', + justifyContent: 'center', + marginTop: '1rem', + alignItems: 'center', + }, + button: { + backgroundColor: currentTheme.colors.background, + color: currentTheme.colors.white, + width: Platform.OS === 'web' ? '20rem' : '20%', + alignItems: 'center', + textAlign: 'center', + }, + }; +}; + +const ModalTriggerButton = ({ setIsModalOpen }) => { + const styles = useCustomStyles(loadStyles); + const { currentTheme } = useTheme(); + + return ( + + { + setIsModalOpen(true); + }} + > + Add Item + + {Platform.OS === 'web' ? ( + + } + /> + ) : null} + + ); +}; diff --git a/client/app/(app)/map/index.tsx b/apps/expo/app/(app)/map/index.tsx similarity index 98% rename from client/app/(app)/map/index.tsx rename to apps/expo/app/(app)/map/index.tsx index fadb98b7c..f77b215d3 100644 --- a/client/app/(app)/map/index.tsx +++ b/apps/expo/app/(app)/map/index.tsx @@ -4,17 +4,16 @@ import { StyleSheet, Text, View, - Picker, TouchableOpacity, } from 'react-native'; import Mapbox from '@rnmapbox/maps'; // get mapbox access token from .env file import { MAPBOX_ACCESS_TOKEN } from '@env'; import { FontAwesome, MaterialCommunityIcons } from '@expo/vector-icons'; -import { theme } from '../../../theme'; -import useTheme from '../../../hooks/useTheme'; +import { theme } from 'app/theme'; +import useTheme from 'app/hooks/useTheme'; import ErrorBoundary from '@packrat/ui'; -import { useCustomStyles } from '~/hooks/useCustomStyles'; +import { useCustomStyles } from 'app/hooks/useCustomStyles'; Mapbox.setAccessToken(MAPBOX_ACCESS_TOKEN); diff --git a/client/app/(app)/maps/index.tsx b/apps/expo/app/(app)/maps/index.tsx similarity index 92% rename from client/app/(app)/maps/index.tsx rename to apps/expo/app/(app)/maps/index.tsx index 1f6566bbe..de3c19825 100644 --- a/client/app/(app)/maps/index.tsx +++ b/apps/expo/app/(app)/maps/index.tsx @@ -2,14 +2,15 @@ import { Modal, Text, View, Image, Dimensions } from 'react-native'; import Mapbox, { offlineManager } from '@rnmapbox/maps'; import { useEffect, useState } from 'react'; import { TouchableOpacity } from 'react-native-gesture-handler'; -import MapButtonsOverlay from '../../../components/map/MapButtonsOverlay'; -import { theme } from '../../../theme'; -import useTheme from '../../../hooks/useTheme'; +import MapButtonsOverlay from 'app/components/map/MapButtonsOverlay'; +import { theme } from 'app/theme'; +import useTheme from 'app/hooks/useTheme'; import { StyleSheet } from 'react-native'; import { calculateZoomLevel, getShapeSourceBounds, -} from '../../../utils/mapFunctions'; +} from 'app/utils/mapFunctions'; +import { api } from 'app/constants/api'; function CircleCapComp() { const { enableDarkMode, enableLightMode, isDark, isLight, currentTheme } = @@ -91,11 +92,9 @@ export default function DownloadedMaps() { borderRadius: 10, }} source={{ - uri: `https://api.mapbox.com/styles/v1/mapbox/streets-v12/static/${ + uri: `${api}/mapPreview/${ pack?.bounds[0] + ',' + pack?.bounds[1] - },10,60,60/600x600?access_token=${ - process.env.MAPBOX_ACCESS_TOKEN - }`, + },10,60,60/600x600`, }} /> )} diff --git a/client/app/(app)/pack/[packId].tsx b/apps/expo/app/(app)/pack/[packId].tsx similarity index 79% rename from client/app/(app)/pack/[packId].tsx rename to apps/expo/app/(app)/pack/[packId].tsx index 020245dbe..63781b479 100644 --- a/client/app/(app)/pack/[packId].tsx +++ b/apps/expo/app/(app)/pack/[packId].tsx @@ -1,6 +1,6 @@ -import PackContainer from '../../../components/pack/PackContainer'; -import { PackDetails } from '../../../components/pack/PackDetails'; -import { DetailsComponent } from '../../../components/details'; +import PackContainer from 'app/components/pack/PackContainer'; +import { PackDetails } from 'app/components/pack/PackDetails'; +import { DetailsComponent } from 'app/components/details'; import { Platform } from 'react-native'; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; diff --git a/client/app/(app)/pack/create.tsx b/apps/expo/app/(app)/pack/create.tsx similarity index 92% rename from client/app/(app)/pack/create.tsx rename to apps/expo/app/(app)/pack/create.tsx index b0cf299d2..7274497ac 100644 --- a/client/app/(app)/pack/create.tsx +++ b/apps/expo/app/(app)/pack/create.tsx @@ -1,4 +1,4 @@ -import { AddPack } from '../../../components/pack/AddPack'; +import { AddPack } from 'app/components/pack/AddPack'; import { Platform } from 'react-native'; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; diff --git a/client/app/(app)/packs/index.tsx b/apps/expo/app/(app)/packs/index.tsx similarity index 93% rename from client/app/(app)/packs/index.tsx rename to apps/expo/app/(app)/packs/index.tsx index 0995ab27a..275bafed4 100644 --- a/client/app/(app)/packs/index.tsx +++ b/apps/expo/app/(app)/packs/index.tsx @@ -1,4 +1,4 @@ -import Feed from '../../../screens/feed/Feed'; +import Feed from 'app/screens/feed/Feed'; import { Platform } from 'react-native'; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; diff --git a/client/app/(app)/password-reset/index.tsx b/apps/expo/app/(app)/password-reset/index.tsx similarity index 80% rename from client/app/(app)/password-reset/index.tsx rename to apps/expo/app/(app)/password-reset/index.tsx index b51cfc53d..aeaecd130 100644 --- a/client/app/(app)/password-reset/index.tsx +++ b/apps/expo/app/(app)/password-reset/index.tsx @@ -1,10 +1,7 @@ import { Platform } from 'react-native'; -import { - RequestPasswordReset, - ResetPassword, -} from '../../../components/password-reset'; +import { RequestPasswordReset } from 'app/components/password-reset'; import { Stack } from 'expo-router'; -import { PasswordResetForm } from '../../../components/password-reset/PasswordResetForm'; +import { PasswordResetForm } from 'app/components/password-reset/PasswordResetForm'; import Head from 'expo-router/head'; export default function ResetPasswordRoute() { diff --git a/client/app/(app)/profile/[id].tsx b/apps/expo/app/(app)/profile/[id].tsx similarity index 92% rename from client/app/(app)/profile/[id].tsx rename to apps/expo/app/(app)/profile/[id].tsx index 82eb64940..cdb90f8c0 100644 --- a/client/app/(app)/profile/[id].tsx +++ b/apps/expo/app/(app)/profile/[id].tsx @@ -1,7 +1,7 @@ import { useSearchParams, Stack } from 'expo-router'; import { useEffect, useState } from 'react'; import { StyleSheet, Text, View, Platform } from 'react-native'; -import ProfileContainer from '../../../screens/user/ProfileContainer'; +import ProfileContainer from 'app/screens/user/ProfileContainer'; import Head from 'expo-router/head'; const Profile = () => { diff --git a/client/app/(app)/profile/index.tsx b/apps/expo/app/(app)/profile/index.tsx similarity index 90% rename from client/app/(app)/profile/index.tsx rename to apps/expo/app/(app)/profile/index.tsx index 033416455..cc9d3a60c 100644 --- a/client/app/(app)/profile/index.tsx +++ b/apps/expo/app/(app)/profile/index.tsx @@ -1,4 +1,4 @@ -import ProfileContainer from '../../../screens/user/ProfileContainer'; +import ProfileContainer from 'app/screens/user/ProfileContainer'; import { Platform, ScrollView } from 'react-native'; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; diff --git a/client/app/(app)/profile/settings/index.tsx b/apps/expo/app/(app)/profile/settings/index.tsx similarity index 92% rename from client/app/(app)/profile/settings/index.tsx rename to apps/expo/app/(app)/profile/settings/index.tsx index 831dd042b..14ec97e8a 100644 --- a/client/app/(app)/profile/settings/index.tsx +++ b/apps/expo/app/(app)/profile/settings/index.tsx @@ -1,6 +1,6 @@ import { Platform, ScrollView } from 'react-native'; import { Stack } from 'expo-router'; -import Settings from '../../../../screens/user/Settings'; +import Settings from 'app/screens/user/Settings'; import Head from 'expo-router/head'; export default function SettingsPage() { diff --git a/client/app/(app)/trip/[tripId].tsx b/apps/expo/app/(app)/trip/[tripId].tsx similarity index 78% rename from client/app/(app)/trip/[tripId].tsx rename to apps/expo/app/(app)/trip/[tripId].tsx index 4ec3baa31..ca114b373 100644 --- a/client/app/(app)/trip/[tripId].tsx +++ b/apps/expo/app/(app)/trip/[tripId].tsx @@ -1,6 +1,6 @@ -import PackContainer from '../../../components/pack/PackContainer'; -import { TripDetails } from '../../../screens/trip/TripDetails'; -import { DetailsComponent } from '../../../components/details'; +import PackContainer from 'app/components/pack/PackContainer'; +import { TripDetails } from 'app/screens/trip/TripDetails'; +import { DetailsComponent } from 'app/components/details'; import { Platform } from 'react-native'; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; diff --git a/client/app/(app)/trip/create.tsx b/apps/expo/app/(app)/trip/create.tsx similarity index 92% rename from client/app/(app)/trip/create.tsx rename to apps/expo/app/(app)/trip/create.tsx index e8dbe4858..7f3aac755 100644 --- a/client/app/(app)/trip/create.tsx +++ b/apps/expo/app/(app)/trip/create.tsx @@ -1,4 +1,4 @@ -import CreateTrip from '../../../screens/trip/createTrip'; +import CreateTrip from 'app/screens/trip/createTrip'; import { Platform } from 'react-native'; import { Stack } from 'expo-router'; diff --git a/client/app/(app)/trips/index.tsx b/apps/expo/app/(app)/trips/index.tsx similarity index 93% rename from client/app/(app)/trips/index.tsx rename to apps/expo/app/(app)/trips/index.tsx index 340a54905..58921470c 100644 --- a/client/app/(app)/trips/index.tsx +++ b/apps/expo/app/(app)/trips/index.tsx @@ -1,4 +1,4 @@ -import Feed from '../../../screens/feed/Feed'; +import Feed from 'app/screens/feed/Feed'; import { Platform } from 'react-native'; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; diff --git a/client/app/(auth)/_layout.tsx b/apps/expo/app/(auth)/_layout.tsx similarity index 70% rename from client/app/(auth)/_layout.tsx rename to apps/expo/app/(auth)/_layout.tsx index 0d5d7448c..408b96ca9 100644 --- a/client/app/(auth)/_layout.tsx +++ b/apps/expo/app/(auth)/_layout.tsx @@ -1,5 +1,5 @@ import { Stack } from 'expo-router'; -import { useProtectedRoute, useSession } from '../../context/auth'; +import { useProtectedRoute, useSession } from 'app/context/auth'; export default function AppLayout() { const { session } = useSession(); diff --git a/client/app/(auth)/register.tsx b/apps/expo/app/(auth)/register.tsx similarity index 94% rename from client/app/(auth)/register.tsx rename to apps/expo/app/(auth)/register.tsx index cb3058e47..acec42743 100644 --- a/client/app/(auth)/register.tsx +++ b/apps/expo/app/(auth)/register.tsx @@ -1,4 +1,4 @@ -import Register from '../../screens/RegisterScreen'; +import Register from 'app/screens/RegisterScreen'; import { Platform } from 'react-native'; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; diff --git a/client/app/(auth)/sign-in.tsx b/apps/expo/app/(auth)/sign-in.tsx similarity index 93% rename from client/app/(auth)/sign-in.tsx rename to apps/expo/app/(auth)/sign-in.tsx index e17593bdc..192f12f49 100644 --- a/client/app/(auth)/sign-in.tsx +++ b/apps/expo/app/(auth)/sign-in.tsx @@ -1,4 +1,4 @@ -import Login from '../../screens/LoginScreen'; +import Login from 'app/screens/LoginScreen'; import { Platform } from 'react-native'; import { Stack } from 'expo-router'; import Head from 'expo-router/head'; diff --git a/client/app/_layout.tsx b/apps/expo/app/_layout.tsx similarity index 64% rename from client/app/_layout.tsx rename to apps/expo/app/_layout.tsx index bf01b425c..b05963a0e 100644 --- a/client/app/_layout.tsx +++ b/apps/expo/app/_layout.tsx @@ -2,10 +2,10 @@ import { Slot } from 'expo-router'; import { Platform, View } from 'react-native'; -import Navigation from '../screens/Navigation'; +import { Navigation } from 'app/components/navigation'; -import { Provider } from '../provider'; -import Footer from '../components/footer/Footer'; +import { Provider } from 'app/provider'; +import Footer from 'app/components/footer/Footer'; export default function HomeLayout() { return ( diff --git a/client/app/index.tsx b/apps/expo/app/index.tsx similarity index 83% rename from client/app/index.tsx rename to apps/expo/app/index.tsx index 3021edd59..2f7408be6 100644 --- a/client/app/index.tsx +++ b/apps/expo/app/index.tsx @@ -1,10 +1,10 @@ import { useSelector } from 'react-redux'; import { Platform, StyleSheet, View } from 'react-native'; import { Stack } from 'expo-router'; -import { darkTheme, theme } from '../theme'; -import LandingPage from '../components/landing_page'; -import Dashboard from '../screens/dashboard'; -import useTheme from '../hooks/useTheme'; +import { darkTheme, theme } from 'app/theme'; +import LandingPage from 'app/components/landing_page'; +import Dashboard from 'app/screens/dashboard'; +import useTheme from 'app/hooks/useTheme'; import { current } from '@reduxjs/toolkit'; import Head from 'expo-router/head'; diff --git a/client/assets/adaptive-icon.png b/apps/expo/assets/adaptive-icon.png similarity index 100% rename from client/assets/adaptive-icon.png rename to apps/expo/assets/adaptive-icon.png diff --git a/client/assets/background-image.png b/apps/expo/assets/background-image.png similarity index 100% rename from client/assets/background-image.png rename to apps/expo/assets/background-image.png diff --git a/client/assets/download.svg b/apps/expo/assets/download.svg similarity index 100% rename from client/assets/download.svg rename to apps/expo/assets/download.svg diff --git a/client/assets/favicon.png b/apps/expo/assets/favicon.png similarity index 100% rename from client/assets/favicon.png rename to apps/expo/assets/favicon.png diff --git a/client/assets/icon.png b/apps/expo/assets/icon.png similarity index 100% rename from client/assets/icon.png rename to apps/expo/assets/icon.png diff --git a/client/assets/images.png b/apps/expo/assets/images.png similarity index 100% rename from client/assets/images.png rename to apps/expo/assets/images.png diff --git a/client/assets/packrat-app-icon.png b/apps/expo/assets/packrat-app-icon.png similarity index 100% rename from client/assets/packrat-app-icon.png rename to apps/expo/assets/packrat-app-icon.png diff --git a/client/assets/packrat-icon-svg.svg b/apps/expo/assets/packrat-icon-svg.svg similarity index 100% rename from client/assets/packrat-icon-svg.svg rename to apps/expo/assets/packrat-icon-svg.svg diff --git a/client/assets/packrat-svg.svg b/apps/expo/assets/packrat-svg.svg similarity index 100% rename from client/assets/packrat-svg.svg rename to apps/expo/assets/packrat-svg.svg diff --git a/client/assets/packrat.png b/apps/expo/assets/packrat.png similarity index 100% rename from client/assets/packrat.png rename to apps/expo/assets/packrat.png diff --git a/client/assets/packrat_icon.png b/apps/expo/assets/packrat_icon.png similarity index 100% rename from client/assets/packrat_icon.png rename to apps/expo/assets/packrat_icon.png diff --git a/client/assets/splash.png b/apps/expo/assets/splash.png similarity index 100% rename from client/assets/splash.png rename to apps/expo/assets/splash.png diff --git a/client/assets/topographical-pattern.jpg b/apps/expo/assets/topographical-pattern.jpg similarity index 100% rename from client/assets/topographical-pattern.jpg rename to apps/expo/assets/topographical-pattern.jpg diff --git a/client/assets/topographical-pattern.png b/apps/expo/assets/topographical-pattern.png similarity index 100% rename from client/assets/topographical-pattern.png rename to apps/expo/assets/topographical-pattern.png diff --git a/client/babel.config.js b/apps/expo/babel.config.js similarity index 78% rename from client/babel.config.js rename to apps/expo/babel.config.js index c01c7364d..ed3844faf 100644 --- a/client/babel.config.js +++ b/apps/expo/babel.config.js @@ -26,15 +26,6 @@ module.exports = function (api) { 'module-resolver', { extensions: ['.ios.js', '.android.js', '.js', '.ts', '.tsx', '.json'], - alias: { - '~/config': './config', - '~/constants': './constants', - '~/components': ['./components'], - '~/utils': ['./utils'], - '~/hooks': ['./hooks'], - '~/store': ['./store'], - '~/theme': ['./theme'], - }, }, ], [ @@ -42,7 +33,7 @@ module.exports = function (api) { { exclude: ['**/node_modules/**'], // components: ['@packrat/ui', 'tamagui'], // this breaks the stylesheet usage on Tamagui components, but fixes build time errors. TODO: fix this - config: './theme/tamagui.config.js', + config: 'app/theme/tamagui.config.js', logTimings: true, }, ], diff --git a/client/eas.json b/apps/expo/eas.json similarity index 100% rename from client/eas.json rename to apps/expo/eas.json diff --git a/client/env.example b/apps/expo/env.example similarity index 100% rename from client/env.example rename to apps/expo/env.example diff --git a/client/gradle.properties.example b/apps/expo/gradle.properties.example similarity index 100% rename from client/gradle.properties.example rename to apps/expo/gradle.properties.example diff --git a/client/index.js b/apps/expo/index.js similarity index 100% rename from client/index.js rename to apps/expo/index.js diff --git a/client/ios/.gitignore b/apps/expo/ios/.gitignore similarity index 100% rename from client/ios/.gitignore rename to apps/expo/ios/.gitignore diff --git a/client/ios/Podfile.properties.json b/apps/expo/ios/Podfile.properties.json similarity index 100% rename from client/ios/Podfile.properties.json rename to apps/expo/ios/Podfile.properties.json diff --git a/client/ios/packrat.xcodeproj/project.pbxproj b/apps/expo/ios/packrat.xcodeproj/project.pbxproj similarity index 100% rename from client/ios/packrat.xcodeproj/project.pbxproj rename to apps/expo/ios/packrat.xcodeproj/project.pbxproj diff --git a/client/ios/packrat.xcodeproj/xcshareddata/xcschemes/packrat.xcscheme b/apps/expo/ios/packrat.xcodeproj/xcshareddata/xcschemes/packrat.xcscheme similarity index 100% rename from client/ios/packrat.xcodeproj/xcshareddata/xcschemes/packrat.xcscheme rename to apps/expo/ios/packrat.xcodeproj/xcshareddata/xcschemes/packrat.xcscheme diff --git a/client/ios/packrat.xcworkspace/contents.xcworkspacedata b/apps/expo/ios/packrat.xcworkspace/contents.xcworkspacedata similarity index 100% rename from client/ios/packrat.xcworkspace/contents.xcworkspacedata rename to apps/expo/ios/packrat.xcworkspace/contents.xcworkspacedata diff --git a/client/ios/packrat.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/expo/ios/packrat.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from client/ios/packrat.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to apps/expo/ios/packrat.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/client/ios/packrat/AppDelegate.h b/apps/expo/ios/packrat/AppDelegate.h similarity index 100% rename from client/ios/packrat/AppDelegate.h rename to apps/expo/ios/packrat/AppDelegate.h diff --git a/client/ios/packrat/AppDelegate.mm b/apps/expo/ios/packrat/AppDelegate.mm similarity index 100% rename from client/ios/packrat/AppDelegate.mm rename to apps/expo/ios/packrat/AppDelegate.mm diff --git a/client/ios/packrat/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png b/apps/expo/ios/packrat/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png similarity index 100% rename from client/ios/packrat/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png rename to apps/expo/ios/packrat/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png diff --git a/client/ios/packrat/Images.xcassets/AppIcon.appiconset/Contents.json b/apps/expo/ios/packrat/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from client/ios/packrat/Images.xcassets/AppIcon.appiconset/Contents.json rename to apps/expo/ios/packrat/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/client/ios/packrat/Images.xcassets/Contents.json b/apps/expo/ios/packrat/Images.xcassets/Contents.json similarity index 100% rename from client/ios/packrat/Images.xcassets/Contents.json rename to apps/expo/ios/packrat/Images.xcassets/Contents.json diff --git a/client/ios/packrat/Images.xcassets/SplashScreen.imageset/Contents.json b/apps/expo/ios/packrat/Images.xcassets/SplashScreen.imageset/Contents.json similarity index 100% rename from client/ios/packrat/Images.xcassets/SplashScreen.imageset/Contents.json rename to apps/expo/ios/packrat/Images.xcassets/SplashScreen.imageset/Contents.json diff --git a/client/ios/packrat/Images.xcassets/SplashScreen.imageset/image.png b/apps/expo/ios/packrat/Images.xcassets/SplashScreen.imageset/image.png similarity index 100% rename from client/ios/packrat/Images.xcassets/SplashScreen.imageset/image.png rename to apps/expo/ios/packrat/Images.xcassets/SplashScreen.imageset/image.png diff --git a/client/ios/packrat/Images.xcassets/SplashScreenBackground.imageset/Contents.json b/apps/expo/ios/packrat/Images.xcassets/SplashScreenBackground.imageset/Contents.json similarity index 100% rename from client/ios/packrat/Images.xcassets/SplashScreenBackground.imageset/Contents.json rename to apps/expo/ios/packrat/Images.xcassets/SplashScreenBackground.imageset/Contents.json diff --git a/client/ios/packrat/Images.xcassets/SplashScreenBackground.imageset/image.png b/apps/expo/ios/packrat/Images.xcassets/SplashScreenBackground.imageset/image.png similarity index 100% rename from client/ios/packrat/Images.xcassets/SplashScreenBackground.imageset/image.png rename to apps/expo/ios/packrat/Images.xcassets/SplashScreenBackground.imageset/image.png diff --git a/client/ios/packrat/Info.plist b/apps/expo/ios/packrat/Info.plist similarity index 100% rename from client/ios/packrat/Info.plist rename to apps/expo/ios/packrat/Info.plist diff --git a/client/ios/packrat/SplashScreen.storyboard b/apps/expo/ios/packrat/SplashScreen.storyboard similarity index 100% rename from client/ios/packrat/SplashScreen.storyboard rename to apps/expo/ios/packrat/SplashScreen.storyboard diff --git a/client/ios/packrat/Supporting/Expo.plist b/apps/expo/ios/packrat/Supporting/Expo.plist similarity index 100% rename from client/ios/packrat/Supporting/Expo.plist rename to apps/expo/ios/packrat/Supporting/Expo.plist diff --git a/client/ios/packrat/main.m b/apps/expo/ios/packrat/main.m similarity index 100% rename from client/ios/packrat/main.m rename to apps/expo/ios/packrat/main.m diff --git a/client/ios/packrat/noop-file.swift b/apps/expo/ios/packrat/noop-file.swift similarity index 100% rename from client/ios/packrat/noop-file.swift rename to apps/expo/ios/packrat/noop-file.swift diff --git a/client/ios/packrat/packrat-Bridging-Header.h b/apps/expo/ios/packrat/packrat-Bridging-Header.h similarity index 100% rename from client/ios/packrat/packrat-Bridging-Header.h rename to apps/expo/ios/packrat/packrat-Bridging-Header.h diff --git a/client/ios/packrat/packrat.entitlements b/apps/expo/ios/packrat/packrat.entitlements similarity index 100% rename from client/ios/packrat/packrat.entitlements rename to apps/expo/ios/packrat/packrat.entitlements diff --git a/client/metro.config.js b/apps/expo/metro.config.js similarity index 91% rename from client/metro.config.js rename to apps/expo/metro.config.js index d40fbee73..c1b512610 100644 --- a/client/metro.config.js +++ b/apps/expo/metro.config.js @@ -19,7 +19,7 @@ config.resolver.sourceExts.push('mjs', 'cjs'); // Find the project and workspace directories const projectRoot = __dirname; -const workspaceRoot = path.resolve(projectRoot, '../'); // Adjust as per your project structure +const workspaceRoot = path.resolve(projectRoot, '../../'); // Adjust as per your project structure // Watch all files within the monorepo config.watchFolders = [workspaceRoot]; diff --git a/client/package.json b/apps/expo/package.json similarity index 90% rename from client/package.json rename to apps/expo/package.json index e910806fc..67ef910e1 100644 --- a/client/package.json +++ b/apps/expo/package.json @@ -1,5 +1,5 @@ { - "name": "packrat", + "name": "expo-app", "version": "1.0.0", "main": "index.js", "scripts": { @@ -41,18 +41,18 @@ "@react-navigation/native-stack": "^6.9.12", "@reduxjs/toolkit": "^1.9.3", "@rnmapbox/maps": "^10.0.0-beta.79", - "@tamagui/animations-react-native": "1.79.14", - "@tamagui/babel-plugin": "1.79.14", - "@tamagui/config": "1.79.14", - "@tamagui/font-inter": "1.79.14", - "@tamagui/linear-gradient": "1.79.14", - "@tamagui/lucide-icons": "1.79.14", - "@tamagui/progress": "1.79.14", - "@tamagui/react-native-media-driver": "1.79.14", - "@tamagui/shorthands": "1.79.14", - "@tamagui/switch": "1.79.14", - "@tamagui/theme-base": "1.79.14", - "@tamagui/themes": "1.79.14", + "@tamagui/animations-react-native": "^1.84.1", + "@tamagui/babel-plugin": "^1.84.1", + "@tamagui/config": "^1.84.1", + "@tamagui/font-inter": "^1.84.1", + "@tamagui/linear-gradient": "^1.84.1", + "@tamagui/lucide-icons": "^1.84.1", + "@tamagui/progress": "^1.84.1", + "@tamagui/react-native-media-driver": "^1.84.1", + "@tamagui/shorthands": "^1.84.1", + "@tamagui/switch": "^1.84.1", + "@tamagui/theme-base": "^1.84.1", + "@tamagui/themes": "^1.84.1", "@tanstack/query-async-storage-persister": "^4.36.1", "@tanstack/react-query": "^4.36.1", "@tanstack/react-query-devtools": "^4.36.1", @@ -61,6 +61,7 @@ "@trpc/client": "^10.38.5", "@trpc/react-query": "^10.38.5", "@trpc/server": "^10.38.5", + "app": "*", "axios": "^1.4.0", "babel-plugin-transform-inline-environment-variables": "^0.4.4", "burnt": "^0.12.1", @@ -119,8 +120,8 @@ "redux-persist": "^6.0.0", "serve": "^14.2.0", "server": "*", - "superjson": "1.10.0", - "tamagui": "1.79.14", + "superjson": "^2.0.0", + "tamagui": "^1.84.1", "togpx": "^0.5.4", "uuid": "3.4.0", "xmldom": "^0.6.0", diff --git a/client/public/favicon.ico b/apps/expo/public/favicon.ico similarity index 100% rename from client/public/favicon.ico rename to apps/expo/public/favicon.ico diff --git a/client/setup.js b/apps/expo/setup.js similarity index 100% rename from client/setup.js rename to apps/expo/setup.js diff --git a/apps/expo/tsconfig.json b/apps/expo/tsconfig.json new file mode 100644 index 000000000..05f6d6f6e --- /dev/null +++ b/apps/expo/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "@tsconfig/react-native/tsconfig.json", + "compilerOptions": { + "lib": ["es2022"], + "alwaysStrict": false, + "strictNullChecks": false, + "strictBindCallApply": false, + "strictFunctionTypes": false, + "strictPropertyInitialization": false, + "noImplicitAny": false, + "noImplicitThis": false, + "useUnknownInCatchVariables": false, + "baseUrl": ".", + }, + "exclude": [ + "node_modules", + "babel.config.js", + "metro.config.js", + "jest.config.js" + ] +} diff --git a/apps/next/.gitignore b/apps/next/.gitignore new file mode 100644 index 000000000..7d093c39f --- /dev/null +++ b/apps/next/.gitignore @@ -0,0 +1,38 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo diff --git a/apps/next/app-env.d.ts b/apps/next/app-env.d.ts new file mode 100644 index 000000000..868bca255 --- /dev/null +++ b/apps/next/app-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/apps/next/next-env.d.ts b/apps/next/next-env.d.ts new file mode 100644 index 000000000..4f11a03dc --- /dev/null +++ b/apps/next/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/apps/next/next.config.js b/apps/next/next.config.js new file mode 100644 index 000000000..911de483a --- /dev/null +++ b/apps/next/next.config.js @@ -0,0 +1,25 @@ +const { withExpo } = require('@expo/next-adapter'); + +/** @type {import('next').NextConfig} */ +const nextConfig = { + // reanimated (and thus, Moti) doesn't work with strict mode currently... + // https://github.com/nandorojo/moti/issues/224 + // https://github.com/necolas/react-native-web/pull/2330 + // https://github.com/nandorojo/moti/issues/224 + // once that gets fixed, set this back to true + reactStrictMode: false, + transpilePackages: [ + 'react-native', + 'react-native-web', + 'solito', + 'dripsy', + '@dripsy/core', + 'moti', + 'app', + 'react-native-reanimated', + '@expo/html-elements', + 'react-native-gesture-handler', + ], +}; + +module.exports = withExpo(nextConfig); diff --git a/apps/next/package.json b/apps/next/package.json new file mode 100644 index 000000000..4afcf44a6 --- /dev/null +++ b/apps/next/package.json @@ -0,0 +1,30 @@ +{ + "name": "next-app", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "@expo/next-adapter": "5.0.2", + "@tamagui/config": "^1.84.1", + "@tamagui/next-theme": "^1.84.1", + "app": "*", + "next": "^13.5.2", + "raf": "^3.4.1", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-native": "0.72.6", + "react-native-web": "~0.19.6", + "react-native-web-lite": "^1.84.1", + "setimmediate": "^1.0.5", + "tamagui": "^1.84.1", + "vercel": "latest" + }, + "devDependencies": { + "@types/node": "^20.8.3" + } +} diff --git a/apps/next/pages/_app.tsx b/apps/next/pages/_app.tsx new file mode 100644 index 000000000..e2ebe94ef --- /dev/null +++ b/apps/next/pages/_app.tsx @@ -0,0 +1,28 @@ +import 'raf/polyfill'; +import 'setimmediate'; + +import { Provider } from 'app/provider'; +import Head from 'next/head'; +import React from 'react'; +import type { SolitoAppProps } from 'solito'; + +function MyApp({ Component, pageProps }: SolitoAppProps) { + return ( + <> + + Solito Example App + + + + {/* Disabling provider until tamagui + next js config is complete */} + {/* */} + + {/* */} + + ); +} + +export default MyApp; diff --git a/apps/next/pages/_document.js b/apps/next/pages/_document.js new file mode 100644 index 000000000..3732d257a --- /dev/null +++ b/apps/next/pages/_document.js @@ -0,0 +1,76 @@ +// Based on https://github.com/zeit/next.js/tree/canary/examples/with-react-native-web +// and https://github.com/expo/expo-cli/blob/main/packages/webpack-config/web-default/index.html +import NextDocument, { Head, Html, Main, NextScript } from 'next/document'; +import * as React from 'react'; +import { AppRegistry } from 'react-native'; + +export const style = ` +/** + * Building on the RNWeb reset: + * https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/exports/StyleSheet/initialRules.js + */ +html, body, #__next { + width: 100%; + /* To smooth any scrolling behavior */ + -webkit-overflow-scrolling: touch; + margin: 0px; + padding: 0px; + /* Allows content to fill the viewport and go beyond the bottom */ + min-height: 100%; +} +#__next { + flex-shrink: 0; + flex-basis: auto; + flex-direction: column; + flex-grow: 1; + display: flex; + flex: 1; +} +html { + scroll-behavior: smooth; + /* Prevent text size change on orientation change https://gist.github.com/tfausak/2222823#file-ios-8-web-app-html-L138 */ + -webkit-text-size-adjust: 100%; + height: 100%; +} +body { + display: flex; + /* Allows you to scroll below the viewport; default value is visible */ + overflow-y: auto; + overscroll-behavior-y: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -ms-overflow-style: scrollbar; +} +`; + +export async function getInitialProps({ renderPage }) { + AppRegistry.registerComponent('Main', () => Main); + const { getStyleElement } = AppRegistry.getApplication('Main'); + const page = await renderPage(); + const styles = [ +