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