import React from 'react'; import { TouchableOpacity, View } from 'react-native'; import { AddressDetails as AddressDetailsController, useOrder, useLanguage, } from 'ordering-components/native'; import { ADContainer, ADHeader, ADAddress, ADMap } from './styles'; import { useTheme } from 'styled-components/native'; import { OText, OIcon } from '../shared'; import { useWindowDimensions } from 'react-native'; const AddressDetailsUI = (props: any) => { const { navigation, addressToShow, isCartPending, googleMapsUrl, apiKey } = props; const theme = useTheme(); const [orderState] = useOrder(); const [, t] = useLanguage(); const { width } = useWindowDimensions(); return ( {t('DELIVERY_ADDRESS', 'Delivery address')} {!!apiKey && ( )} {addressToShow || orderState?.options?.address?.address} {orderState?.options?.address?.address_notes} {orderState?.options?.type === 1 && !isCartPending && ( navigation.navigate('AddressList', { isFromCheckout: true }) }> {t('CHANGE', 'Change')} )} ); }; export const AddressDetails = (props: any) => { const addressDetailsProps = { ...props, UIComponent: AddressDetailsUI, }; return ; };