import React from 'react'; import { useLanguage, useOrder } from 'ordering-components-external/native'; import { useTheme } from 'styled-components/native'; import { StyleSheet, View } from 'react-native'; import { OButton, OIcon, OText } from '../shared'; import { LanguageSelector } from '../LanguageSelector'; import { TouchableOpacity } from 'react-native-gesture-handler'; import { useWindowDimensions } from 'react-native'; export const Home = (props: any) => { const { onNavigationRedirect, isSingleBusiness, singleBusiness } = props; const { width } = useWindowDimensions(); const [, t] = useLanguage(); const [orderState] = useOrder(); const theme = useTheme(); return ( {t('WELCOME', 'Welcome!')} {t('LETS_START_ORDER', "Let's start to order now")} onNavigationRedirect('Login')} imgRightSrc={null} /> onNavigationRedirect('Signup')} imgRightSrc={null} /> orderState?.options?.address?.address ? isSingleBusiness ? onNavigationRedirect('Business', { store: singleBusiness }) : onNavigationRedirect('BusinessList', { isGuestUser: true }) : onNavigationRedirect('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', paddingHorizontal: 40, }, logo: { marginTop: 64, }, buttons: { marginVertical: 6, borderRadius: 7.6, }, sloganText: { textAlign: 'center', }, wrapperBtn: { width: '100%', position: 'absolute', bottom: 0, marginBottom: 20, }, });