Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VIP Travel] Add Workspace Address context - newDot #41201

Merged
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
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2449,6 +2449,7 @@ export default {
save: 'Save',
genericFailureMessage: 'An error occurred updating the workspace, please try again.',
avatarUploadFailureMessage: 'An error occurred uploading the avatar, please try again.',
addressContext: 'A Workspace Address is required to enable Expensify Travel. Please enter an address associated with your business.',
},
bankAccount: {
continueWithSetup: 'Continue with setup',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2485,6 +2485,7 @@ export default {
save: 'Guardar',
genericFailureMessage: 'Se produjo un error al guardar el espacio de trabajo. Por favor, inténtalo de nuevo.',
avatarUploadFailureMessage: 'No se pudo subir el avatar. Por favor, inténtalo de nuevo.',
addressContext: 'Se requiere una dirección para habilitar Expensify Travel. Por favor, introduce una dirección asociada con tu negocio.',
},
bankAccount: {
continueWithSetup: 'Continuar con la configuración',
Expand Down
7 changes: 7 additions & 0 deletions src/pages/workspace/WorkspaceProfileAddressPage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import type {StackScreenProps} from '@react-navigation/stack';
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {View} from 'react-native';
import AddressForm from '@components/AddressForm';
import type {FormOnyxValues} from '@components/Form/types';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ScreenWrapper from '@components/ScreenWrapper';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
import {updateAddress} from '@userActions/Policy';
Expand All @@ -21,6 +24,7 @@ type WorkspaceProfileAddressPagePolicyProps = WithPolicyProps;
type WorkspaceProfileAddressPageProps = StackScreenProps<SettingsNavigatorParamList, typeof SCREENS.WORKSPACE.ADDRESS> & WorkspaceProfileAddressPagePolicyProps;

function WorkspaceProfileAddressPage({policy, route}: WorkspaceProfileAddressPageProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const address = useMemo(() => policy?.address, [policy]);
const [currentCountry, setCurrentCountry] = useState(address?.country);
Expand Down Expand Up @@ -102,6 +106,9 @@ function WorkspaceProfileAddressPage({policy, route}: WorkspaceProfileAddressPag
shouldShowBackButton
onBackButtonPress={() => Navigation.goBack()}
/>
<View style={[styles.ph5, styles.mv3, styles.flexRow, styles.flexWrap]}>
<Text>{translate('workspace.editor.addressContext')}</Text>
</View>
<AddressForm
formID={ONYXKEYS.FORMS.HOME_ADDRESS_FORM}
onSubmit={updatePolicyAddress}
Expand Down
Loading