upd: bug bg saat pindah page
This commit is contained in:
@@ -20,10 +20,12 @@ import { StatusBar } from 'expo-status-bar';
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { Easing, Notifier } from 'react-native-notifier';
|
import { Easing, Notifier } from 'react-native-notifier';
|
||||||
import { Provider } from "react-redux";
|
import { Provider } from "react-redux";
|
||||||
|
import { useTheme } from "@/providers/ThemeProvider";
|
||||||
|
|
||||||
export default function RootLayout() {
|
export default function RootLayout() {
|
||||||
const { token, decryptToken, isLoading } = useAuthSession()
|
const { token, decryptToken, isLoading } = useAuthSession()
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
|
const { colors } = useTheme()
|
||||||
|
|
||||||
async function handleReadNotification(id: string, category: string, idContent: string, title: string) {
|
async function handleReadNotification(id: string, category: string, idContent: string, title: string) {
|
||||||
try {
|
try {
|
||||||
@@ -93,11 +95,10 @@ export default function RootLayout() {
|
|||||||
<Stack screenOptions={{
|
<Stack screenOptions={{
|
||||||
headerShown: true,
|
headerShown: true,
|
||||||
animation: "slide_from_right",
|
animation: "slide_from_right",
|
||||||
|
|
||||||
// ⬇️ PENTING BANGET
|
|
||||||
animationTypeForReplace: "pop",
|
animationTypeForReplace: "pop",
|
||||||
fullScreenGestureEnabled: true,
|
fullScreenGestureEnabled: true,
|
||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
|
contentStyle: { backgroundColor: colors.header },
|
||||||
}} >
|
}} >
|
||||||
<Stack.Screen name="home" options={{ title: 'Home' }} />
|
<Stack.Screen name="home" options={{ title: 'Home' }} />
|
||||||
<Stack.Screen name="feature" options={{ title: 'Fitur' }} />
|
<Stack.Screen name="feature" options={{ title: 'Fitur' }} />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import AuthProvider from '@/providers/AuthProvider';
|
import AuthProvider from '@/providers/AuthProvider';
|
||||||
import ThemeProvider from '@/providers/ThemeProvider';
|
import ThemeProvider, { useTheme } from '@/providers/ThemeProvider';
|
||||||
import { useFonts } from 'expo-font';
|
import { useFonts } from 'expo-font';
|
||||||
import { Stack } from 'expo-router';
|
import { Stack } from 'expo-router';
|
||||||
import * as SplashScreen from 'expo-splash-screen';
|
import * as SplashScreen from 'expo-splash-screen';
|
||||||
@@ -13,6 +13,22 @@ import Styles from '@/constants/Styles';
|
|||||||
// Prevent the splash screen from auto-hiding before asset loading is complete.
|
// Prevent the splash screen from auto-hiding before asset loading is complete.
|
||||||
SplashScreen.preventAutoHideAsync();
|
SplashScreen.preventAutoHideAsync();
|
||||||
|
|
||||||
|
// Inner component - berada di dalam ThemeProvider, bisa pakai useTheme()
|
||||||
|
function AppStack() {
|
||||||
|
const { colors } = useTheme();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack screenOptions={{ contentStyle: { backgroundColor: colors.header } }}>
|
||||||
|
<Stack.Screen name="index" options={{ headerShown: false }} />
|
||||||
|
<Stack.Screen name="verification" options={{ headerShown: false }} />
|
||||||
|
<Stack.Screen name="(application)" options={{ headerShown: false }} />
|
||||||
|
</Stack>
|
||||||
|
<StatusBar style="auto" />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default function RootLayout() {
|
export default function RootLayout() {
|
||||||
const [loaded] = useFonts({
|
const [loaded] = useFonts({
|
||||||
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
|
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
|
||||||
@@ -33,12 +49,7 @@ export default function RootLayout() {
|
|||||||
<NotifierWrapper>
|
<NotifierWrapper>
|
||||||
<ThemeProvider>
|
<ThemeProvider>
|
||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
<Stack>
|
<AppStack />
|
||||||
<Stack.Screen name="index" options={{ headerShown: false }} />
|
|
||||||
<Stack.Screen name="verification" options={{ headerShown: false }} />
|
|
||||||
<Stack.Screen name="(application)" options={{ headerShown: false }} />
|
|
||||||
</Stack>
|
|
||||||
<StatusBar style="auto" />
|
|
||||||
</AuthProvider>
|
</AuthProvider>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</NotifierWrapper>
|
</NotifierWrapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user