diff --git a/src/components/modals/LoadingModal.tsx b/src/components/modals/LoadingModal.tsx
new file mode 100644
index 0000000..c8d7aa5
--- /dev/null
+++ b/src/components/modals/LoadingModal.tsx
@@ -0,0 +1,28 @@
+import Box from "@components/bases/Box";
+import { ActivityIndicator, Text } from "react-native";
+
+const LoadingModal = () => {
+ return (
+
+
+ Veuillez patienter
+
+ );
+};
+
+export default LoadingModal;
diff --git a/src/contexts/Overlay.tsx b/src/contexts/Overlay.tsx
index 54ac5de..9e4b4a1 100644
--- a/src/contexts/Overlay.tsx
+++ b/src/contexts/Overlay.tsx
@@ -1,3 +1,4 @@
+import LoadingModal from "@components/modals/LoadingModal";
import { createContext, useContext, useState } from "react";
import { View } from "react-native";
@@ -12,14 +13,17 @@ export const OverlayContext = createContext({
});
export const OverlayProvider = ({ children }: { children: React.ReactNode }) => {
- const [overlayVisible, setOverlayVisible] = useState(false);
+ const [showBackdrop, setShowBackdrop] = useState(true);
+ const [loadingModalVisible, setLoadingModalVisible] = useState(true);
const showOverlay = () => {
- setOverlayVisible(true);
+ setShowBackdrop(true);
+ setLoadingModalVisible(true);
};
const hideOverlay = () => {
- setOverlayVisible(false);
+ setShowBackdrop(false);
+ setLoadingModalVisible(false);
};
return (
@@ -30,8 +34,9 @@ export const OverlayProvider = ({ children }: { children: React.ReactNode }) =>
}}
>
{children}
- {/* */}
- {overlayVisible && }
+ {showBackdrop && }
+
+ {loadingModalVisible && }
);
};
@@ -40,15 +45,15 @@ export const useOverlayContext = () => {
return useContext(OverlayContext);
};
-const OverlayComponent = () => {
+const OverlayBackdrop = () => {
return (