Skip to content

Commit

Permalink
upgrade to latest canary
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon committed Oct 24, 2024
1 parent 1ea7077 commit 723c38c
Show file tree
Hide file tree
Showing 11 changed files with 1,379 additions and 2,048 deletions.
8 changes: 6 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@
}
},
"plugins": [
"expo-font",
"expo-router"
[
"expo-router",
{
"sitemap": false
}
]
]
}
}
112 changes: 0 additions & 112 deletions app/(index,orders,products,analytics)/_layout.native.tsx

This file was deleted.

122 changes: 117 additions & 5 deletions app/(index,orders,products,analytics)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,122 @@
import { router, Link, Slot, Stack } from "expo-router";
import { Image } from "react-native";
import { TouchableImpact } from "@/components/touchable-impact";

import { PlatformColor } from "react-native";

import { ShadLayoutFull } from "@/components/shad/shad-layout";
import { router, Slot } from "expo-router";

export default function RootLayout() {
export default function RootLayout({ segment }: { segment: string }) {
if (process.env.EXPO_OS === "web") {
return (
<ShadLayoutFull navigate={router.navigate}>
<Slot />
</ShadLayoutFull>
);
}

// TODO: Add header bar
// return <Slot />;

const name = getRouteName(segment);
return (
<ShadLayoutFull navigate={router.navigate}>
<Slot />
</ShadLayoutFull>
<Stack
screenOptions={{
headerTransparent: true,
headerBlurEffect: "prominent",
headerShadowVisible: true,
headerLargeTitleShadowVisible: false,
headerStyle: {
// Hack to ensure the collapsed small header shows the shadow / border.
backgroundColor: "rgba(255,255,255,0.01)",
},
headerLargeStyle: {
backgroundColor: PlatformColor("systemGroupedBackgroundColor"), // Color of your background
},
contentStyle: {
backgroundColor: PlatformColor("systemGroupedBackgroundColor"),
},
}}
>
<Stack.Screen
name={name}
options={{
title: titles[name],
headerLargeTitle: true,
headerSearchBarOptions: {},
headerRight() {
return <ProfileButton segment={segment} />;
},

//
...(name !== "index"
? {
headerLargeTitle: undefined,
headerSearchBarOptions: undefined,
}
: {}),
}}
/>
<Stack.Screen
name="settings"
options={{
title: "Settings",
presentation: "modal",
headerTransparent: true,
headerBlurEffect: "prominent",
headerShadowVisible: true,
headerStyle: {
// Hack to ensure the collapsed small header shows the shadow / border.
backgroundColor: "rgba(255,255,255,0.01)",
},
}}
/>
</Stack>
);
}

function ProfileButton({ segment }: { segment: string }) {
return (
<Link href={`/${segment}/settings`} asChild>
<TouchableImpact
style={{
aspectRatio: 1,
}}
>
<Image
style={{
width: 30,
height: 30,
aspectRatio: 1,
borderRadius: 24,
}}
source={require("@/public/evanbacon.jpg")}
/>
</TouchableImpact>
</Link>
);
}

export const unstable_settings = {
initialRouteName: "index",
orders: {
initialRouteName: "orders",
},
products: {
initialRouteName: "products",
},
analytics: {
initialRouteName: "analytics",
},
};

const titles = {
index: "Dashboard",
orders: "Orders",
products: "Products",
analytics: "Analytics",
};

function getRouteName(segment: string) {
return segment.replace(/\((.+)\)/, "$1") as keyof typeof titles;
}
2 changes: 1 addition & 1 deletion components/flow/flow.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
}

.react-flow__edge .react-flow__edge-path {
stroke: url(#edge-gradient);
/* stroke: url(#edge-gradient); */
stroke-width: 2;
stroke-opacity: 0.75;
}
Expand Down
3 changes: 1 addition & 2 deletions eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
},
"production": {
"resourceClass": "large",
"autoIncrement": true,
"prebuildCommand": "npx expo prebuild --template ./vendor/expo-template-bare-minimum-51.0.27.tgz"
"autoIncrement": true
}
},
"submit": {
Expand Down
3 changes: 2 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { LogBox } from "react-native";
import * as Notifications from "expo-notifications";

LogBox.ignoreLogs([
"Failed to attach search bar to the header",
"functionality provided by expo-notifications",
"functionality is not fully supported in Expo Go",
// Shows when adding the tab bar during fast refresh. Maybe related to the scrolling system?
"Error evaluating injectedJavaScript:",
]);
Expand Down
51 changes: 24 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"android": "CUSTOM_RUN=1 expo run:android",
"ios": "CUSTOM_RUN=1 expo run:ios",
"lint": "expo lint",
"prebuild": "expo prebuild --template ./vendor/expo-template-bare-minimum-51.0.27.tgz",
"predeploy:web": "expo export -p web",
"deploy:web": "netlify deploy --dir dist",
"prepare": "npx patch-package"
Expand All @@ -31,8 +30,6 @@
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@react-navigation/drawer": "^6.7.2",
"@react-navigation/native": "^6.0.2",
"@react-three/drei": "9.105.6",
"@react-three/fiber": "8.16.6",
"@tiptap/core": "^2.6.4",
Expand All @@ -54,23 +51,23 @@
"clsx": "^2.1.1",
"emoji-mart": "^5.6.0",
"eruda": "^3.2.3",
"expo": "52.0.0-canary-20240912-1059f85",
"expo-application": "6.0.0-canary-20240912-1059f85",
"expo-asset": "11.0.0-canary-20240912-1059f85",
"expo-blur": "14.0.0-canary-20240912-1059f85",
"expo-constants": "17.0.0-canary-20240912-1059f85",
"expo-file-system": "18.0.0-canary-20240912-1059f85",
"expo-font": "13.0.0-canary-20240912-1059f85",
"expo-haptics": "14.0.0-canary-20240912-1059f85",
"expo-keep-awake": "14.0.0-canary-20240912-1059f85",
"expo-linking": "7.0.0-canary-20240912-1059f85",
"expo-modules-core": "2.0.0-canary-20240912-1059f85",
"expo-notifications": "1.0.0-canary-20240912-1059f85",
"expo-router": "4.0.0-canary-20240912-1059f85",
"expo-splash-screen": "1.0.0-canary-20240912-1059f85",
"expo-status-bar": "1.12.2-canary-20240912-1059f85",
"expo-system-ui": "4.0.0-canary-20240912-1059f85",
"expo-web-browser": "14.0.0-canary-20240912-1059f85",
"expo": "52.0.0-preview.3",
"expo-application": "~6.0.1",
"expo-asset": "~11.0.0",
"expo-blur": "~14.0.1",
"expo-constants": "~17.0.1",
"expo-file-system": "~18.0.0",
"expo-font": "~13.0.0",
"expo-haptics": "~14.0.0",
"expo-keep-awake": "~14.0.1",
"expo-linking": "~7.0.1",
"expo-modules-core": "~2.0.0-preview.3",
"expo-notifications": "~0.29.2",
"expo-router": "~4.0.0-preview.1",
"expo-splash-screen": "~0.28.2",
"expo-status-bar": "~2.0.0",
"expo-system-ui": "~4.0.1",
"expo-web-browser": "~14.0.0",
"lucide-react": "^0.408.0",
"lucide-react-native": "^0.436.0",
"postcss": "~8.4.32",
Expand All @@ -81,14 +78,14 @@
"react-icons": "^5.3.0",
"react-mobile-cropper": "^0.10.0",
"react-native": "0.75.2",
"react-native-gesture-handler": "~2.18.1",
"react-native-maps": "1.14.0",
"react-native-reanimated": "~3.15.0",
"react-native-safe-area-context": "4.10.9",
"react-native-screens": "3.31.1",
"react-native-svg": "15.2.0",
"react-native-gesture-handler": "~2.20.2",
"react-native-maps": "1.18.0",
"react-native-reanimated": "~3.16.1",
"react-native-safe-area-context": "4.11.0",
"react-native-screens": "4.0.0-beta.14",
"react-native-svg": "15.8.0",
"react-native-web": "~0.19.10",
"react-native-webview": "13.8.6",
"react-native-webview": "13.12.2",
"recharts": "alpha",
"sass": "^1.77.8",
"tailwind-merge": "^2.4.0",
Expand Down
Loading

0 comments on commit 723c38c

Please sign in to comment.