frontend client for gemstone. decentralised workplace app

refactor: use a slot instead

serenity e53973e3 50965501

Changed files
+20 -21
src
app
(protected)
+18 -7
src/app/(protected)/_layout.tsx
···
import { SessionGate } from "@/components/Auth/SessionGate";
+
import { ChannelsDrawer } from "@/components/Navigation/ChannelsDrawer";
import { TopBar } from "@/components/Navigation/TopBar";
import { Stack } from "@/components/primitives/Stack";
import { AuthedProviders } from "@/providers/authed";
import { useCurrentPalette } from "@/providers/ThemeProvider";
+
import { View } from "react-native";
export default function ProtectedLayout() {
const { semantic } = useCurrentPalette();
return (
<SessionGate>
<AuthedProviders>
-
<TopBar />
-
<Stack
-
screenOptions={{
-
contentStyle: {
-
backgroundColor: semantic.background,
-
},
+
<View
+
style={{
+
flexDirection: "column",
+
flex: 1,
+
backgroundColor: semantic.background,
}}
-
/>
+
>
+
<TopBar />
+
<ChannelsDrawer />
+
<Stack
+
screenOptions={{
+
contentStyle: {
+
backgroundColor: semantic.background,
+
},
+
}}
+
/>
+
</View>
</AuthedProviders>
</SessionGate>
);
+2 -14
src/app/_layout.tsx
···
-
import { Stack } from "@/components/primitives/Stack";
import { isDevMode } from "@/lib/utils/env";
import { RootProviders } from "@/providers";
-
import { useCurrentPalette } from "@/providers/ThemeProvider";
import {
Lexend_100Thin,
Lexend_200ExtraLight,
···
Lexend_900Black,
useFonts,
} from "@expo-google-fonts/lexend";
-
import { SplashScreen } from "expo-router";
+
import { Slot, SplashScreen } from "expo-router";
import { useEffect } from "react";
import { Platform } from "react-native";
···
Lexend_900Black,
});
-
const { semantic } = useCurrentPalette();
-
useEffect(() => {
if (!isDevMode) return;
if (Platform.OS === "web" && typeof window !== "undefined") {
···
return null;
}
-
return (
-
<Stack
-
screenOptions={{
-
contentStyle: {
-
backgroundColor: semantic.background,
-
},
-
}}
-
/>
-
);
+
return <Slot />;
};
const RootLayout = () => {