Skip to content

Commit

Permalink
chore: remove hardcoded locale switching button (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsyirvo authored Nov 11, 2024
1 parent cccba59 commit a07cbe8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/core/i18n/resources/en/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const messages = {
},
},
},
cta: 'Submit',
screenTitle: 'Dummy form',
},
errorBoundary: {
Expand Down
1 change: 1 addition & 0 deletions src/core/i18n/resources/fr/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const messages: MessagesTypes = {
},
},
},
cta: 'Valider',
screenTitle: 'Dummy form',
},
errorBoundary: {
Expand Down
12 changes: 1 addition & 11 deletions src/features/dummyForm/DummyFormExample.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/* eslint-disable react/jsx-props-no-spreading */

import { zodResolver } from '@hookform/resolvers/zod';
import { useRef } from 'react';
import type { SubmitHandler } from 'react-hook-form';
import { Controller, useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import type { TextInput } from 'react-native';

import { changeLanguage } from '$core/i18n';
import {
DummyFormSchema,
type DummyFormSchemaType,
Expand All @@ -34,13 +31,6 @@ export const DummyFormExample = () => {

return (
<>
<Button.Text
testID="home-formattingCta"
onPress={async () => changeLanguage('en')}
>
Set locale to FR
</Button.Text>

<Box pb="spacing_16">
<Controller
control={control}
Expand Down Expand Up @@ -117,7 +107,7 @@ export const DummyFormExample = () => {
testID="dummyForm-submitCta"
onPress={handleSubmit(onSubmit) as (arg: unknown) => Promise<unknown>}
>
Submit
{t('miscScreens.dummyForm.cta')}
</Button.Text>
</>
);
Expand Down

0 comments on commit a07cbe8

Please sign in to comment.