Skip to content

Commit

Permalink
🔧 Update superstruct to version 0.6.2 and mixin-object to version 2.0.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stringsaeed committed Apr 19, 2024
1 parent 1cd6685 commit d11dd4f
Show file tree
Hide file tree
Showing 65 changed files with 2,229 additions and 1,800 deletions.
27 changes: 1 addition & 26 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"apc.activityBar": {
"position": "bottom",
"hideSettings": true,
"size": 23
},
"apc.statusBar": {
"position": "editor-bottom",
"height": 22,
"fontSize": 12
},
"apc.electron": {
"titleBarStyle": "hiddenInset",
"trafficLightPosition": {
"x": 8,
"y": 10
}
},
"apc.header": {
"height": 34,
"fontSize": 14
},
"apc.listRow": {
"height": 21,
"fontSize": 13
}
"typescript.tsdk": "node_modules/typescript/lib"
}
11 changes: 2 additions & 9 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,8 @@ export default ({ config }: ConfigContext): ExpoConfig => {
"expo-build-properties",
{
ios: {
extraPods: [
{
path: "../node_modules/@nozbe/simdjson",
configurations: ["Debug", "Release"],
modular_headers: true,
name: "simdjson",
},
],
deploymentTarget: "14.0",
useFrameworks: "static",
},
},
],
Expand All @@ -61,7 +54,7 @@ export default ({ config }: ConfigContext): ExpoConfig => {
},
],
"expo-apple-authentication",
["expo-router", { origin: "http://localhost:8081/" }],
"expo-router",
],
android: {
adaptiveIcon: {
Expand Down
5 changes: 4 additions & 1 deletion eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"distribution": "internal",
"env": {
"TAMAGUI_TARGET": "native",
"APP_VARIANT": "development"
"APP_VARIANT": "development",
"SENTRY_AUTH_TOKEN": "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",
"SENTRY_PROJECT": "brim-mobile",
"SENTRY_ORG": "baeynh-rt"
},
"channel": "development"
},
Expand Down
2 changes: 1 addition & 1 deletion knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { KnipConfig } from "knip";

const config: KnipConfig = {
project: ["src/**/*.ts", "src/**/*.tsx"],
entry: ["./App.tsx"],
// entry: ["expo-router/entry"],
};

export default config;
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,22 @@
"@google/generative-ai": "^0.1.3",
"@gorhom/bottom-sheet": "^4.6.0",
"@hookform/resolvers": "^3.3.4",
"@langchain/core": "^0.1.24",
"@nozbe/watermelondb": "^0.27.1",
"@legendapp/state": "^2.1.8",
"@react-native-firebase/app": "^19.0.1",
"@react-native-firebase/auth": "^19.0.1",
"@react-native-firebase/database": "^19.0.1",
"@react-native-menu/menu": "^0.9.1",
"@react-navigation/elements": "^1.3.21",
"@react-navigation/native": "^6.1.9",
"@react-navigation/native-stack": "^6.9.17",
"@sentry/react-native": "5.17.0",
"@shopify/flash-list": "1.6.3",
"@shopify/react-native-skia": "0.1.221",
"@supabase/supabase-js": "^2.39.3",
"@tamagui/animations-moti": "^1.88.17",
"@tamagui/config": "^1.88.17",
"@tamagui/font-inter": "^1.88.17",
"@tamagui/linear-gradient": "^1.88.17",
"@tamagui/lucide-icons": "^1.88.17",
"@tamagui/animations-moti": "^1.90.6",
"@tamagui/config": "^1.90.6",
"@tamagui/font-inter": "^1.90.6",
"@tamagui/linear-gradient": "^1.90.6",
"@tamagui/lucide-icons": "^1.90.6",
"@tanstack/react-query": "^5.18.0",
"axios": "^1.6.7",
"date-fns": "^3.3.1",
"expo": "~50.0.7",
"expo-apple-authentication": "~6.3.0",
Expand Down Expand Up @@ -92,7 +91,7 @@
"react-native-svg": "14.1.0",
"react-native-url-polyfill": "^2.0.0",
"react-native-web": "~0.19.6",
"tamagui": "^1.88.17",
"tamagui": "^1.90.6",
"ts-pattern": "^5.0.6",
"vexo-analytics": "^1.3.13",
"zeego": "^1.7.2",
Expand All @@ -104,8 +103,8 @@
"@babel/plugin-proposal-decorators": "^7.23.3",
"@callstack/eslint-config": "^14.1.0",
"@manypkg/cli": "^0.21.2",
"@tamagui/babel-plugin": "^1.88.17",
"@tamagui/cli": "^1.88.17",
"@tamagui/babel-plugin": "^1.90.6",
"@tamagui/cli": "^1.90.6",
"@testing-library/jest-native": "^5.4.3",
"@testing-library/react-native": "^12.4.3",
"@types/google-libphonenumber": "^7.4.30",
Expand Down
49 changes: 0 additions & 49 deletions src/app/(app)/_layout.tsx

This file was deleted.

91 changes: 70 additions & 21 deletions src/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
import { DatabaseProvider } from "@nozbe/watermelondb/react";
import {
DarkTheme,
DefaultTheme,
Expand All @@ -14,21 +14,33 @@ import { GestureHandlerRootView } from "react-native-gesture-handler";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { TamaguiProvider } from "tamagui";

import { wmDatabase } from "config";
import { NotesProvider, PullToActionProvider, QueryProvider } from "contexts";
import { useLoadAssets, useUserTheme } from "hooks";
import {
AuthenticationProvider,
NotesProvider,
PullToActionProvider,
QueryProvider,
} from "contexts";
import { useLoadAssets, useUserAccent, useUserTheme } from "hooks";
import i18next from "i18n";
import { FeatureFlagsProvider } from "services";
import { themeConfig } from "themes";

export default function AppContainer() {
const { theme } = useUserTheme();
const { accent } = useUserAccent();
const isLoaded = useLoadAssets();

const screenOptions = useMemo<NativeStackNavigationOptions>(
() => ({ headerShown: false }),
[]
);
const screenOptions = useMemo<NativeStackNavigationOptions>(() => {
const selectiveTheme = themeConfig.themes[theme];

return {
headerTintColor: selectiveTheme[accent].val,
headerBackTitleVisible: false,
headerShadowVisible: false,
headerBackTitle: "",
};
}, [accent, theme]);

const navigationTheme = useMemo(() => {
const baseTheme = theme === "dark" ? DarkTheme : DefaultTheme;
const selectiveTheme = themeConfig.themes[theme];
Expand All @@ -37,11 +49,11 @@ export default function AppContainer() {
colors: {
...baseTheme.colors,
background: selectiveTheme.background.val,
primary: selectiveTheme.accent.val,
primary: selectiveTheme[accent].val,
text: selectiveTheme.color.val,
},
};
}, [theme]);
}, [accent, theme]);

if (!isLoaded) {
return null;
Expand All @@ -53,19 +65,56 @@ export default function AppContainer() {
<TamaguiProvider defaultTheme={theme} config={themeConfig}>
<ThemeProvider value={navigationTheme}>
<QueryProvider>
<DatabaseProvider database={wmDatabase}>
<NotesProvider>
<GestureHandlerRootView style={styles.rootView}>
<SafeAreaProvider>
<BottomSheetModalProvider>
<NotesProvider>
<GestureHandlerRootView style={styles.rootView}>
<SafeAreaProvider>
<BottomSheetModalProvider>
<AuthenticationProvider>
<PullToActionProvider>
<Stack screenOptions={screenOptions} />
<Stack screenOptions={screenOptions}>
<Stack.Screen
name="(app)/index"
options={{ title: "" }}
/>
<Stack.Screen
name="(app)/notes/[id]"
options={{ headerTransparent: true, title: "" }}
/>
<Stack.Screen
name="(app)/notes/archived"
options={{ title: "Archived" }}
/>
<Stack.Screen
name="(app)/notes/trashed"
options={{ title: "Trash" }}
/>
<Stack.Screen
name="(app)/user/profile"
options={{ title: "Settings" }}
/>
<Stack.Screen
name="(app)/user/account-info"
options={{ title: "Account Information" }}
/>
<Stack.Screen
name="(app)/user/preferences"
options={{ title: "Preferences" }}
/>
<Stack.Screen
name="auth"
options={{
headerTransparent: true,
presentation: "modal",
title: "",
}}
/>
</Stack>
</PullToActionProvider>
</BottomSheetModalProvider>
</SafeAreaProvider>
</GestureHandlerRootView>
</NotesProvider>
</DatabaseProvider>
</AuthenticationProvider>
</BottomSheetModalProvider>
</SafeAreaProvider>
</GestureHandlerRootView>
</NotesProvider>
</QueryProvider>
</ThemeProvider>
</TamaguiProvider>
Expand Down
11 changes: 11 additions & 0 deletions src/app/auth/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Stack } from "expo-router";
import React from "react";

export default function AuthLayout() {
return (
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="login" />
<Stack.Screen name="verify" />
</Stack>
);
}
3 changes: 3 additions & 0 deletions src/app/auth/login.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AuthenticationScreens } from "screens";

export default AuthenticationScreens.Login;
3 changes: 3 additions & 0 deletions src/app/auth/verify.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AuthenticationScreens } from "screens";

export default AuthenticationScreens.Verify;
22 changes: 22 additions & 0 deletions src/components/back-button/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
HeaderBackButton,
HeaderBackButtonProps,
} from "@react-navigation/elements";
import { ChevronLeft } from "@tamagui/lucide-icons";
import React from "react";

export default function BackButton({
canGoBack,
...props
}: HeaderBackButtonProps) {
if (!canGoBack) {
return null;
}
return (
<HeaderBackButton
{...props}
labelVisible={false}
backImage={() => <ChevronLeft size="$2" color="$accent" />}
/>
);
}
6 changes: 5 additions & 1 deletion src/components/bottom-sheet/accent-backdrop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ import Animated, {
} from "react-native-reanimated";
import { useTheme } from "tamagui";

import { useUserAccent } from "hooks";
import { UserAccentValue } from "types";

export default function AccentBackdrop({
animatedIndex,
style,
}: BottomSheetBackdropProps) {
const { accent: accentValue } = useUserAccent();
const theme = useTheme();
const accent = theme.accent.get();
const accent = theme[accentValue as UserAccentValue].val;
const { close } = useBottomSheet();

const handleOnPress = useCallback(() => {
Expand Down
Loading

0 comments on commit d11dd4f

Please sign in to comment.