-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from himanshu8443/feature
Features and bug fixes
- Loading branch information
Showing
28 changed files
with
831 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import {View, Text} from 'react-native'; | ||
import React from 'react'; | ||
import useContentStore from '../lib/zustand/contentStore'; | ||
import {providersList} from '../lib/constants'; | ||
import {ScrollView} from 'moti'; | ||
import MaterialIcons from '@expo/vector-icons/MaterialIcons'; | ||
import useThemeStore from '../lib/zustand/themeStore'; | ||
import {TouchableOpacity} from 'react-native'; | ||
import {DrawerLayout} from 'react-native-gesture-handler'; | ||
|
||
const ProviderDrawer = ({ | ||
drawerRef, | ||
}: { | ||
drawerRef: React.RefObject<DrawerLayout>; | ||
}) => { | ||
const {provider, setProvider} = useContentStore(state => state); | ||
const {primary} = useThemeStore(state => state); | ||
|
||
return ( | ||
<View className="px-3"> | ||
<View className="mt-6 p-2 flex flex-row justify-center items-center gap-x-3"> | ||
<MaterialIcons name="extension" size={24} color={primary} /> | ||
<Text className="text-white text-2xl">Providers</Text> | ||
</View> | ||
<ScrollView showsVerticalScrollIndicator={false} className="mb-20"> | ||
{providersList.map(item => ( | ||
<TouchableOpacity | ||
key={item.value} | ||
onPress={() => { | ||
setProvider(item); | ||
drawerRef.current?.closeDrawer(); | ||
}} | ||
className={`bg-black text-white w-48 flex-row justify-start gap-2 items-center px-4 py-1 rounded-s-md border-b border-white/10 border rounded-md ${ | ||
provider.value === item.value ? 'bg-quaternary' : '' | ||
} ${item.value === 'lux' ? 'pb-1' : 'pb-3'}`}> | ||
<Text className=" text-white mb-2"> | ||
{item.flag} | ||
| ||
{item.name} | ||
</Text> | ||
</TouchableOpacity> | ||
))} | ||
</ScrollView> | ||
</View> | ||
); | ||
}; | ||
|
||
export default ProviderDrawer; |
Oops, something went wrong.