1- import { Link } from 'expo-router' ;
1+ import { useRouter } from 'expo-router' ;
22import React from 'react' ;
33import { View , Text , StyleSheet , ScrollView , Pressable } from 'react-native' ;
4+ import FontAwesome from '@expo/vector-icons/FontAwesome' ;
45import CustomHeader from '@/components/CustomHeader' ;
56
6- const routes = [
7- { href : '/permissions/location' , title : 'Location (foreground/background)' } ,
8- { href : '/permissions/camera-mic' , title : 'Camera & Microphone' } ,
9- { href : '/permissions/notifications' , title : 'Notifications' } ,
10- { href : '/permissions/media-storage' , title : 'Media Library' } ,
11- { href : '/permissions/storage' , title : 'Storage & File Access' } ,
12- { href : '/permissions/telephony-sms' , title : 'Telephony & SMS' } ,
13- { href : '/permissions/connectivity' , title : 'Bluetooth & Nearby' } ,
7+ const routes : Array < { href : string ; title : string ; icon : string ; color : string } > = [
8+ { href : '/permissions/location' , title : 'Location (foreground/background)' , icon : '📍' , color : '#4CAF50' } ,
9+ { href : '/permissions/camera-mic' , title : 'Camera & Microphone' , icon : '📷' , color : '#E91E63' } ,
10+ { href : '/permissions/notifications' , title : 'Notifications' , icon : '🔔' , color : '#FF9800' } ,
11+ { href : '/permissions/media-storage' , title : 'Media Library' , icon : '🖼️' , color : '#9C27B0' } ,
12+ { href : '/permissions/storage' , title : 'Storage & File Access' , icon : '📁' , color : '#00BCD4' } ,
13+ { href : '/permissions/telephony-sms' , title : 'Telephony & SMS' , icon : '📱' , color : '#F44336' } ,
14+ { href : '/permissions/connectivity' , title : 'Bluetooth & Nearby' , icon : '📶' , color : '#3F51B5' } ,
1415] ;
1516
1617export default function PermissionsHub ( ) {
18+ const router = useRouter ( ) ;
19+
1720 return (
1821 < View style = { styles . container } >
1922 < CustomHeader title = "Permissions Hub" />
@@ -24,12 +27,14 @@ export default function PermissionsHub() {
2427 </ Text >
2528 { routes . map ( ( route ) => (
2629 < View style = { styles . card } key = { route . href } >
27- < Text style = { styles . cardTitle } > { route . title } </ Text >
28- < Link href = { route . href } asChild >
29- < Pressable style = { styles . button } >
30- < Text style = { styles . buttonText } > Open demo</ Text >
31- </ Pressable >
32- </ Link >
30+ < Text style = { styles . cardTitle } > { route . icon } { route . title } </ Text >
31+ < Pressable
32+ style = { [ styles . button , { backgroundColor : route . color } ] }
33+ onPress = { ( ) => router . push ( route . href as any ) }
34+ >
35+ < Text style = { styles . buttonText } > Open demo</ Text >
36+ < FontAwesome name = "chevron-right" size = { 12 } color = "#fff" style = { styles . buttonArrow } />
37+ </ Pressable >
3338 </ View >
3439 ) ) }
3540 </ ScrollView >
@@ -53,8 +58,12 @@ const styles = StyleSheet.create({
5358 button : {
5459 backgroundColor : '#1e88e5' ,
5560 paddingVertical : 10 ,
61+ paddingHorizontal : 16 ,
5662 borderRadius : 8 ,
63+ flexDirection : 'row' ,
5764 alignItems : 'center' ,
65+ justifyContent : 'center' ,
5866 } ,
59- buttonText : { color : '#fff' , fontWeight : '600' } ,
67+ buttonText : { color : '#fff' , fontWeight : '600' , fontSize : 14 } ,
68+ buttonArrow : { marginLeft : 8 , marginTop : 2 } ,
6069} ) ;
0 commit comments