Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions src/components/HomeMenuComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
import React from 'react';
import {View} from 'react-native';
import {View, TouchableWithoutFeedback} from 'react-native';
import {SvgProps} from 'react-native-svg';

import {homeScreenStyles} from '../theme/homeScreenStyles';
import {useNavigation} from '@react-navigation/native';

export interface Props {
svgIcon: React.FC<SvgProps>;
footerColor: string;
navigateToScreen: string;
}

export const HomeMenuComponent = ({svgIcon, footerColor}: Props) => {
export const HomeMenuComponent = ({
svgIcon,
footerColor,
navigateToScreen,
}: Props) => {
const navigation = useNavigation();

const Icon = svgIcon as React.FC<SvgProps>;

return (
<View style={homeScreenStyles.optionContainer}>
<Icon style={homeScreenStyles.optionIcon}></Icon>
<View
style={{
...homeScreenStyles.optionFooter,
backgroundColor: footerColor,
}}></View>
</View>
<TouchableWithoutFeedback
onPress={() => navigation.navigate(navigateToScreen as never)}>
<View style={homeScreenStyles.optionContainer}>
<Icon style={homeScreenStyles.optionIcon}></Icon>
<View
style={{
...homeScreenStyles.optionFooter,
backgroundColor: footerColor,
}}></View>
</View>
</TouchableWithoutFeedback>
);
};
30 changes: 22 additions & 8 deletions src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,35 @@ export const HomeScreen = () => {
const appVersion = DeviceInfo.getVersion();
return (
// <ScrollView style={{backgroundColor: 'transparent', flex: 1}}> </ScrollView>
<View style={{ backgroundColor: '#E5E5E5',flex:1}}>
<View
style={{ flex: 1, justifyContent:'center'}}>
<HomeMenuComponent svgIcon={Ic_Appointment} footerColor="#E68038" />
<HomeMenuComponent svgIcon={Ic_Promotions} footerColor="#3F80EC" />
<HomeMenuComponent svgIcon={Ic_My_Account} footerColor="#00559C" />
<View style={{backgroundColor: '#E5E5E5', flex: 1}}>
<View style={{flex: 1, justifyContent: 'center'}}>
<HomeMenuComponent
svgIcon={Ic_Appointment}
footerColor="#E68038"
navigateToScreen="TutorialScreen"
/>
<HomeMenuComponent
svgIcon={Ic_Promotions}
footerColor="#3F80EC"
navigateToScreen="TutorialScreen"
/>
<HomeMenuComponent
svgIcon={Ic_My_Account}
footerColor="#00559C"
navigateToScreen="TutorialScreen"
/>
</View>
<View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
marginHorizontal: 18,
marginBottom:20
marginBottom: 20,
}}>
<Text onPress={async () => await Linking.openURL(Constants.TermsAndConditionsUri) }
<Text
onPress={async () =>
await Linking.openURL(Constants.TermsAndConditionsUri)
}
style={{
color: '#2097F6',
fontSize: 12,
Expand Down