Skip to content

Commit f814bc0

Browse files
committed
chore(sample): update home screen
1 parent 1652c5c commit f814bc0

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

sample/src/components/HomeListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type Props = React.PropsWithChildren<{
77
onPress: () => void;
88
title: string;
99
desc: string;
10-
image: any;
10+
image: number;
1111
}>;
1212
const HomeListItem = ({ title, desc, image, onPress }: Props) => {
1313
const { select, colors } = useUIKitTheme();

sample/src/screens/HomeScreen.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Alert, FlatList, Pressable, StyleSheet, View } from 'react-native';
2+
import { FlatList, Pressable, StyleSheet, View } from 'react-native';
33
import { useSafeAreaInsets } from 'react-native-safe-area-context';
44

55
import { useConnection } from '@sendbird/uikit-react-native';
@@ -11,7 +11,7 @@ import { useAppNavigation } from '../hooks/useAppNavigation';
1111
import { useAppAuth } from '../libs/authentication';
1212
import { 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

4147
const 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

Comments
 (0)