Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo navigation #160

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1ec2551
Start react navigation project
jthoward64 Feb 22, 2025
7411f62
Add initial screen components and header icons for navigation
jthoward64 Feb 22, 2025
cfc51f7
Set up more of the UI
jthoward64 Feb 23, 2025
1b42a32
Port more of login over
jthoward64 Feb 23, 2025
a0c1b70
Refactor mobile app structure: remove unused index file, add Tailwind…
jthoward64 Feb 23, 2025
3bf0d1d
Refactor navigation background cutout component and update loading pr…
jthoward64 Feb 23, 2025
245a6fe
Add NativeWind type definitions, update app configuration, remove unu…
jthoward64 Feb 23, 2025
cc339cc
Update development environment: add Tailwind CSS extension, refactor …
jthoward64 Feb 23, 2025
53a418c
Refactor project structure: remove global CSS file, update import pat…
jthoward64 Feb 24, 2025
6159e5c
Wrap up with tab navigation
jthoward64 Feb 24, 2025
c0ea645
Add RefreshInstagramTokenJob to schedule token refresh and enhance In…
jthoward64 Feb 24, 2025
e8b8d3e
Enhance FetchError class: add private URL property and update constru…
jthoward64 Feb 24, 2025
f1555f5
Cleanup src
jthoward64 Feb 24, 2025
76490c1
Update redirect path in SplashLoginScreen to point to the explore tab
jthoward64 Feb 24, 2025
5fb4312
Refactor import paths for login and layout components to improve code…
jthoward64 Feb 24, 2025
dd63ef6
Refactor directory structure: move API-related files to a dedicated a…
jthoward64 Feb 24, 2025
b58af03
Add audio UI
jthoward64 Feb 24, 2025
315eca4
Finish explore screen
jthoward64 Feb 25, 2025
b7da83d
Add DBMoments feature: implement camera functionality, save moments, …
jthoward64 Feb 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or with the host.
"forwardPorts": [5173, 8000, 8081, 5432],
"forwardPorts": [5173, 8000, 8081, 5432, 8097],
"portsAttributes": {
"5173": {
"label": "Admin Portal",
Expand Down Expand Up @@ -46,6 +46,10 @@
"4040": {
"label": "Ngrok Tunnel",
"onAutoForward": "ignore"
},
"8097": {
"label": "Expo React Devtools",
"onAutoForward": "ignore"
}
},

Expand Down Expand Up @@ -87,7 +91,8 @@
"mtxr.sqltools-driver-pg",
"fill-labs.dependi",
"yoavbls.pretty-ts-errors",
"nicoespeon.abracadabra"
"nicoespeon.abracadabra",
"bradlc.vscode-tailwindcss"
]
}
},
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"GitHub.vscode-pull-request-github",
"fill-labs.dependi",
"yoavbls.pretty-ts-errors",
"nicoespeon.abracadabra"
"nicoespeon.abracadabra",
"bradlc.vscode-tailwindcss"
]
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
"typescript.disableAutomaticTypeAcquisition": true,
"typescript.experimental.updateImportsOnPaste": true,
"typescript.experimental.expandableHover": true,
"typescript.preferences.preferTypeOnlyAutoImports": true
"typescript.preferences.preferTypeOnlyAutoImports": true,
"tailwindCSS.classAttributes": ["class", "className", "headerClassName"]
}
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ export default eslintTs.config(
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/require-await": "error",
"@typescript-eslint/return-await": "error",
"@typescript-eslint/no-empty-object-type": [
"error",
{
allowInterfaces: "with-single-extends",
},
],
"@typescript-eslint/no-invalid-void-type": [
"error",
{
Expand Down
10 changes: 9 additions & 1 deletion packages/common/lib/error/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@ import { ErrorCode } from "./index.js";

export class FetchError extends ExtendedError {
#responseText: string | undefined = undefined;
#url: string | undefined = undefined;

constructor(
public readonly response: Response,
public readonly url?: string | URL
url?: string | URL
) {
super(
`Fetch failed with status ${response.status}: ${response.statusText}`,
ErrorCode.FetchError.description
);
if (url != null) {
this.#url = url.toString();
}
}

get url(): string | undefined {
return this.#url ?? this.response.url;
}

get detailedMessage(): string {
Expand Down
12 changes: 6 additions & 6 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./client-parsers": {
"import": "./dist/client-parsers/index.js",
"types": "./dist/client-parsers/index.d.ts"
"types": "./dist/client-parsers/index.d.ts",
"default": "./dist/client-parsers/index.js"
},
"./error": {
"import": "./dist/error/index.js",
"types": "./dist/error/index.d.ts"
"types": "./dist/error/index.d.ts",
"default": "./dist/error/index.js"
}
},
"main": "./dist/index.js",
Expand Down
6 changes: 6 additions & 0 deletions packages/mobile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
# The following patterns were generated by expo-cli

expo-env.d.ts
# @end expo-cli
6 changes: 3 additions & 3 deletions packages/mobile/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ import { LoadingWrapper } from "@/context/loading";
import { UrqlContext } from "@/context/urql";
import { navigationIntegration } from "@/navigation/routingInstrumentation";

import { overrideApiBaseUrl } from "./_src/common/apiUrl";
import { FilledNavigationContainer } from "./_src/navigation/NavigationContainer";
import { getCustomTheme } from "./_src/theme";
import BoldoniFlfBoldFont from "./assets/fonts/bodoni-flf-font/Bodoni-FLF-Bold.ttf";
import BoldoniFlfBoldItalicFont from "./assets/fonts/bodoni-flf-font/Bodoni-FLF-Bold-Italic.ttf";
import BoldoniFlfItalicFont from "./assets/fonts/bodoni-flf-font/Bodoni-FLF-Italic.ttf";
import BoldoniFlfRomanFont from "./assets/fonts/bodoni-flf-font/Bodoni-FLF-Roman.ttf";
import OpenSansCondensedBoldFont from "./assets/fonts/opensans-condensed/OpenSans-Condensed-Bold.ttf";
import OpenSansCondensedLightFont from "./assets/fonts/opensans-condensed/OpenSans-Condensed-Light.ttf";
import OpenSansCondensedLightItalicFont from "./assets/fonts/opensans-condensed/OpenSans-Condensed-Light-Italic.ttf";
import { overrideApiBaseUrl } from "./src/common/apiUrl";
import { FilledNavigationContainer } from "./src/navigation/NavigationContainer";
import { getCustomTheme } from "./src/theme";

const metadata = "metadata" in manifest ? manifest.metadata : undefined;
const extra = "extra" in manifest ? manifest.extra : undefined;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Text, TouchableOpacity, useWindowDimensions } from "react-native";
import { useColorModeValue, useThemeColors } from "@/common/customHooks";
import { colors } from "@/theme/colors";

import BackgroundCutout from "../../../../assets/screens/navigation/background-cutout";
import BackgroundCutout from "../../../../src/svgs/background-cutout";
import DanceBlueRibbon from "../../../common/components/svgs/DBRibbon";
import { useReactNavigationTheme } from "../../../theme";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export type RootStackParamList = {
export type RootStackScreenProps<T extends keyof RootStackParamList> =
NativeStackScreenProps<RootStackParamList, T>;

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace ReactNavigation {
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface RootParamList extends RootStackParamList {}
}
}
// declare global {
// // eslint-disable-next-line @typescript-eslint/no-namespace
// namespace ReactNavigation {
// // eslint-disable-next-line @typescript-eslint/no-empty-object-type
// interface RootParamList extends RootStackParamList {}
// }
// }
14 changes: 11 additions & 3 deletions packages/mobile/app.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
"notification": {
"icon": "./assets/app/20th-appicon.png"
},
"platforms": ["ios", "android"],
"experiments": {
"typedRoutes": true,
"reactCompiler": true
},
"userInterfaceStyle": "automatic",
"platforms": ["ios", "android", "web"],
"orientation": "portrait",
"icon": "./assets/app/20th-appicon.png",
"splash": {
Expand Down Expand Up @@ -40,7 +45,6 @@
"cameraPermission": "Allow DanceBlue to access your microphone."
}
],
"expo-av",
"expo-secure-store",
"expo-file-system",
[
Expand Down Expand Up @@ -76,14 +80,18 @@
}
],
"expo-build-properties",
"expo-router"
"expo-router",
"expo-audio"
],
"updates": {
"enabled": true,
"checkAutomatically": "ON_LOAD",
"url": "https://u.expo.dev/86042d7a-cd35-415c-87ed-f53c008b3827"
},
"assetBundlePatterns": ["assets/**"],
"web": {
"bundler": "metro"
},
"ios": {
"supportsTablet": true,
"config": {
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const nativeVersion: Version = {

// Both the sum of version.patch + buildsThisVersion and the sum of baseBuildCount + buildsThisVersion must increase each time a native build is submitted.
const baseBuildCount = 46;
const buildsThisVersion = 1;
const buildsThisVersion = 2;

/*
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
85 changes: 0 additions & 85 deletions packages/mobile/assets/screens/navigation/background-cutout.tsx

This file was deleted.

5 changes: 4 additions & 1 deletion packages/mobile/babel.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ module.exports = function babel(api) {
api.cache.forever();

return {
presets: ["babel-preset-expo"],
presets: [
["babel-preset-expo", { jsxImportSource: "nativewind" }],
"nativewind/babel",
],
plugins: ["react-native-reanimated/plugin"],
};
};
6 changes: 6 additions & 0 deletions packages/mobile/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"aliases": {
"components": "~/components",
"lib": "~/lib"
}
}
3 changes: 0 additions & 3 deletions packages/mobile/index.js

This file was deleted.

20 changes: 8 additions & 12 deletions packages/mobile/metro.config.cjs
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
// Learn more https://docs.expo.io/guides/cus tomizing-metro
// @ts-expect-error - CommonJS
const { withSentryConfig } = require("@sentry/react-native/metro");
// @ts-expect-error - CommonJS
const { getDefaultConfig } = require("expo/metro-config");
const { withNativeWind } = require("nativewind/metro");

// Find the project and workspace directories
// eslint-disable-next-line no-undef
const projectRoot = __dirname;

const config = withSentryConfig(getDefaultConfig(projectRoot));
const config = getDefaultConfig(projectRoot);

/** @type {Partial<Record<string, string>>} */
const ALIASES = {
"type-graphql": "type-graphql/shim",
};

// @ts-expect-error - It is defined by expo/metro-config
config.resolver /*
Only ignore the first bit
*/.resolveRequest =
config.resolver.resolveRequest =
/** @type {import("metro-resolver").CustomResolver} */
(context, moduleName, platform) => {
// Ensure you call the default resolver.
Expand All @@ -30,9 +26,9 @@ Only ignore the first bit
);
};

// @ts-expect-error - It is defined by expo/metro-config
config.resolver /*
Only ignore the first bit
*/.unstable_enablePackageExports = true;
config.resolver.unstable_enablePackageExports = true;
config.resolver.unstable_conditionNames = ["require", "react-native"];

module.exports = config;
module.exports = withNativeWind(withSentryConfig(config), {
input: "./src/global.css",
});
3 changes: 3 additions & 0 deletions packages/mobile/nativewind-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference types="nativewind/types" />

// NOTE: This file should not be edited and should be committed with your source code. It is generated by NativeWind.
Loading