aboutsummaryrefslogtreecommitdiff
path: root/src/View.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/View.tsx')
-rw-r--r--src/View.tsx29
1 files changed, 29 insertions, 0 deletions
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>
+ );
+};