Добавлены уведомления
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
import { Stack } from "expo-router";
|
||||
import { StatusBar } from "expo-status-bar";
|
||||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
|
||||
import { AppProvider } from "../src/app-context";
|
||||
import { colors } from "../src/theme";
|
||||
|
||||
export default function RootLayout() {
|
||||
useEffect(() => {
|
||||
if (typeof window === "undefined") return;
|
||||
const capture = (event: Event) => {
|
||||
event.preventDefault();
|
||||
(window as typeof window & { __hanInstallPrompt?: Event }).__hanInstallPrompt = event;
|
||||
};
|
||||
window.addEventListener("beforeinstallprompt", capture);
|
||||
return () => window.removeEventListener("beforeinstallprompt", capture);
|
||||
}, []);
|
||||
|
||||
return <SafeAreaProvider>
|
||||
<AppProvider>
|
||||
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}>
|
||||
|
||||
Reference in New Issue
Block a user