11import React from 'react' ;
2- import { Alert , FlatList , Pressable , StyleSheet , View } from 'react-native' ;
2+ import { FlatList , Pressable , StyleSheet , View } from 'react-native' ;
33import { useSafeAreaInsets } from 'react-native-safe-area-context' ;
44
55import { useConnection } from '@sendbird/uikit-react-native' ;
@@ -11,7 +11,7 @@ import { useAppNavigation } from '../hooks/useAppNavigation';
1111import { useAppAuth } from '../libs/authentication' ;
1212import { Routes } from '../libs/navigation' ;
1313
14- const HomeItems : { title : string ; desc ?: string ; image ?: any ; route ?: Routes } [ ] = [
14+ const HomeItems = [
1515 {
1616 image : require ( '../assets/imgGroupchannel.png' ) ,
1717 title : 'Group channel' ,
@@ -25,18 +25,24 @@ const HomeItems: { title: string; desc?: string; image?: any; route?: Routes }[]
2525 route : Routes . OpenChannelTabs ,
2626 } ,
2727 {
28+ image : undefined ,
2829 title : 'Storybook' ,
30+ desc : '' ,
2931 route : Routes . Storybook ,
3032 } ,
3133 {
34+ image : undefined ,
3235 title : 'Palette' ,
36+ desc : '' ,
3337 route : Routes . Palette ,
3438 } ,
3539 {
40+ image : undefined ,
3641 title : 'Themed colors' ,
42+ desc : '' ,
3743 route : Routes . ThemeColors ,
3844 } ,
39- ] ;
45+ ] as const ;
4046
4147const HomeScreen = ( ) => {
4248 const { top, bottom, left, right } = useSafeAreaInsets ( ) ;
@@ -63,21 +69,15 @@ const HomeScreen = () => {
6369 < HomeListItem
6470 image = { item . image }
6571 title = { item . title }
66- desc = { item . desc || '' }
67- onPress = { ( ) => {
68- if ( ! item . route ) return Alert . alert ( 'Sorry' , 'Not implemented yet' ) ;
69- navigation . navigate ( item . route ) ;
70- } }
72+ desc = { item . desc }
73+ onPress = { ( ) => navigation . navigate ( item . route ) }
7174 />
7275 ) ;
7376 }
7477
7578 return (
7679 < Pressable
77- onPress = { ( ) => {
78- if ( ! item . route ) return Alert . alert ( 'Sorry' , 'Not implemented yet' ) ;
79- navigation . navigate ( item . route ) ;
80- } }
80+ onPress = { ( ) => navigation . navigate ( item . route ) }
8181 style = { [
8282 styles . customSampleButton ,
8383 { backgroundColor : select ( { light : colors . background , dark : colors . onBackground04 } ) } ,
0 commit comments