import React from 'react'; import { useLanguage, useOrder } from 'ordering-components/native'; import { useTheme } from 'styled-components/native'; import { StyleSheet, View, Dimensions, Platform, useWindowDimensions } from 'react-native'; import { OButton, OIcon, OText } from '../shared'; import { LogoWrapper, Slogan } from './styles'; import { LanguageSelector } from '../LanguageSelector' import { TouchableOpacity } from 'react-native-gesture-handler'; import { _setStoreData } from '../../providers/StoreUtil'; const windowHeight = Dimensions.get('window').height export const Home = (props: any) => { const { width, height } = useWindowDimensions(); const { onNavigationRedirect } = props; const theme = useTheme(); const [, t] = useLanguage(); const [orderState] = useOrder(); const handleGuessFlow = (page: string, params: any) => { onNavigationRedirect(page, params); _setStoreData('isGuestUser', true); }; return ( onNavigationRedirect('Login')} /> onNavigationRedirect('Signup')} /> orderState?.options?.address?.address ? handleGuessFlow('BusinessList',{ isGuestUser: true } ) : handleGuessFlow('AddressForm',{ isGuestUser: true } ) } > {t('CONTINUE_AS_GUEST', 'Continue as guest')} ); }; const styles = StyleSheet.create({ textLink: { flexDirection: 'row', textAlign: 'center', justifyContent: 'center', alignItems: 'center' }, container: { flex: 1, alignItems: 'center', justifyContent: 'space-between', }, logo: { height: 80, width: 250, marginTop: 10 }, slogan: { height: windowHeight / 2, width: 400 }, buttons: { marginVertical: 10, marginHorizontal: 30 }, sloganText: { textAlign: 'center' }, wrapperContent: { marginTop: 20, }, wrapperBtn: { width: '100%', position: 'absolute', bottom: 0, marginBottom: 20 } });