From bac973fb3d933c383cc69612c7ffc45ece837dde Mon Sep 17 00:00:00 2001
From: Akshay Nair <phenax5@gmail.com>
Date: Sun, 29 Sep 2024 13:19:11 +0530
Subject: Switch to jotai atom with storage + suspense for favorites list

---
 src/AppView.tsx | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 src/AppView.tsx

(limited to 'src/AppView.tsx')

diff --git a/src/AppView.tsx b/src/AppView.tsx
new file mode 100644
index 0000000..cca64f6
--- /dev/null
+++ b/src/AppView.tsx
@@ -0,0 +1,27 @@
+import React, {useEffect, useState} from 'react';
+import Swiper from 'react-native-swiper';
+import {AppList} from './screens/AppList';
+import {Home} from './screens/Home';
+import {useInstalledApps} from './hooks/useInstalledApps';
+
+export const AppView: React.FC = React.memo(() => {
+  const {refreshApps} = useInstalledApps();
+  const [screenIndex, setScreenIndex] = useState(0);
+
+  useEffect(() => {
+    refreshApps();
+  }, [screenIndex, refreshApps]);
+
+  return (
+    <Swiper
+      horizontal
+      autoplay={false}
+      loop={false}
+      dot={<></>}
+      activeDot={<></>}
+      onIndexChanged={setScreenIndex}>
+      <Home active={screenIndex === 0} />
+      <AppList active={screenIndex === 1} />
+    </Swiper>
+  );
+});
-- 
cgit v1.3.1

