diff options
| author | Akshay Nair <phenax5@gmail.com> | 2024-09-28 13:46:22 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2024-09-29 16:16:39 +0530 |
| commit | a1143f3696a0b272018f7eea43ee23a674c618e1 (patch) | |
| tree | 2289e6a1fbf47d339cb41849f9554d403bd837cc /src/View.tsx | |
| parent | 5d456899ea444301870e1d3c721d139c9251c531 (diff) | |
| download | daft-launcher-a1143f3696a0b272018f7eea43ee23a674c618e1.tar.gz daft-launcher-a1143f3696a0b272018f7eea43ee23a674c618e1.zip | |
Add context menu for apps (fav,settings,uninstall)
Diffstat (limited to 'src/View.tsx')
| -rw-r--r-- | src/View.tsx | 29 |
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> + ); +}; |
