From a1143f3696a0b272018f7eea43ee23a674c618e1 Mon Sep 17 00:00:00 2001
From: Akshay Nair <phenax5@gmail.com>
Date: Sat, 28 Sep 2024 13:46:22 +0530
Subject: Add context menu for apps (fav,settings,uninstall)

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

(limited to 'src/View.tsx')

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

