From 26b53e2ccc00befd182c4af05ab52fc439be7535 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Fri, 29 Mar 2024 14:17:36 +0000
Subject: mobile(android): Getting the android app ready for submission

---
 apps/mobile/components/ui/CustomSafeAreaView.tsx | 28 ++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 apps/mobile/components/ui/CustomSafeAreaView.tsx

(limited to 'apps/mobile/components/ui/CustomSafeAreaView.tsx')

diff --git a/apps/mobile/components/ui/CustomSafeAreaView.tsx b/apps/mobile/components/ui/CustomSafeAreaView.tsx
new file mode 100644
index 00000000..c97dfe72
--- /dev/null
+++ b/apps/mobile/components/ui/CustomSafeAreaView.tsx
@@ -0,0 +1,28 @@
+import { Platform, SafeAreaView } from "react-native";
+import { useSafeAreaInsets } from "react-native-safe-area-context";
+import { useHeaderHeight } from "@react-navigation/elements";
+
+export default function CustomSafeAreaView({
+  children,
+}: {
+  children: React.ReactNode;
+}) {
+  const insets = useSafeAreaInsets();
+  const headerHeight = useHeaderHeight();
+
+  return (
+    <SafeAreaView
+      style={{
+        paddingTop:
+          // Some ugly hacks to make the app look the same on both android and ios
+          Platform.OS == "android"
+            ? headerHeight > 0
+              ? headerHeight
+              : insets.top
+            : undefined,
+      }}
+    >
+      {children}
+    </SafeAreaView>
+  );
+}
-- 
cgit v1.2.3-70-g09d2

