Skip to content

Commit

Permalink
Merge pull request #41201 from software-mansion-labs/travel/workspace…
Browse files Browse the repository at this point in the history
…-profile-address-subtext

[VIP Travel] Add Workspace Address context - newDot
  • Loading branch information
marcochavezf authored May 13, 2024
2 parents c7aff11 + 0e35627 commit abf9f8d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2452,6 +2452,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 @@ -2488,6 +2488,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

0 comments on commit abf9f8d

Please sign in to comment.