Skip to content

Commit

Permalink
chore: change strings to translation contants
Browse files Browse the repository at this point in the history
  • Loading branch information
TravellerOnTheRun committed Sep 21, 2023
1 parent ccf7ac6 commit 0c8cd67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/lib/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const resources = {
address_copied_to_keyboard: 'Address copied to Clipboard',
message_copied_to_clipboard: 'Copied to Clipboard',
ok: 'OK',
back: 'Go Back',
basic_row_pending: '• Pending',
basic_row_failed: '• Failed',
type_placeholder: 'type...',
Expand Down Expand Up @@ -175,6 +176,8 @@ const resources = {
contact_form_button_convert_checksum: 'Convert to correct checksum',
contact_form_button_add_proposed_contact: 'Add',
contact_form_button_add_proposed_contact_ending: 'to your Contacts',
contact_form_alert_title: 'Contact already exists!',
contact_form_edit_existing_button: 'Edit existing contact',
transaction_form_label_asset: 'asset',
transaction_summary_screen_title: 'Transaction Summary',
transaction_summary_send_title: 'Send',
Expand Down
10 changes: 7 additions & 3 deletions src/screens/contacts/ContactFormScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ export const ContactFormScreen = ({
formState: { errors },
} = methods

// form values
const addressObj = watch('address')
const nameValue = watch('name')

// form errors
const hasErrors =
addressObj.address.length === 0 ||
nameValue.length === 0 ||
Expand Down Expand Up @@ -145,16 +148,16 @@ export const ContactFormScreen = ({
const contactExists = checkIfContactExists(displayAddress, contacts)

if (contactExists) {
Alert.alert('Contact already exists!', undefined, [
Alert.alert(t('contact_form_alert_title'), undefined, [
{
text: 'Go Back',
text: t('back'),
onPress: () => {
navigation.replace(contactsStackRouteNames.ContactsList)
proposed && navigation.navigate(rootTabsRouteNames.Home)
},
},
{
text: 'Edit existing contact',
text: t('contact_form_edit_existing_button'),
onPress: () => {
dispatch(editContact(contact))
navigation.replace(contactsStackRouteNames.ContactsList)
Expand All @@ -181,6 +184,7 @@ export const ContactFormScreen = ({
proposed,
contacts,
checkIfContactExists,
t,
],
)

Expand Down

0 comments on commit 0c8cd67

Please sign in to comment.