This commit is contained in:
Amruth Pillai
2023-04-21 01:13:32 +02:00
parent 6f219ef17e
commit 6a8db92fc4
15 changed files with 53 additions and 50 deletions
+9 -7
View File
@@ -89,7 +89,7 @@ const UserProfileModal = () => {
render={({ field, fieldState }) => (
<TextField
autoFocus
label={t('modals.auth.profile.form.name.label')}
label={t<string>('modals.auth.profile.form.name.label')}
error={!!fieldState.error}
helperText={fieldState.error?.message}
{...field}
@@ -114,16 +114,16 @@ const UserProfileModal = () => {
render={({ field, fieldState }) => (
<TextField
disabled
label={t('modals.auth.profile.form.email.label')}
label={t<string>('modals.auth.profile.form.email.label')}
error={!!fieldState.error}
helperText={t('modals.auth.profile.form.email.help-text')}
helperText={t<string>('modals.auth.profile.form.email.help-text')}
{...field}
/>
)}
/>
<div>
<Button onClick={handleUpdate}>{t('modals.auth.profile.actions.save')}</Button>
<Button onClick={handleUpdate}>{t<string>('modals.auth.profile.actions.save')}</Button>
</div>
</form>
@@ -133,10 +133,12 @@ const UserProfileModal = () => {
<div className="flex items-center gap-2">
<CrisisAlert />
<h5 className="font-medium">{t('modals.auth.profile.delete-account.heading')}</h5>
<h5 className="font-medium">{t<string>('modals.auth.profile.delete-account.heading')}</h5>
</div>
<p className="text-xs opacity-75">{t('modals.auth.profile.delete-account.body', { keyword: 'delete' })}</p>
<p className="text-xs opacity-75">
{t<string>('modals.auth.profile.delete-account.body', { keyword: 'delete' })}
</p>
<div className="flex max-w-xs flex-col gap-4">
<TextField
@@ -147,7 +149,7 @@ const UserProfileModal = () => {
<div>
<Button variant="contained" color="error" disabled={!isDeleteTextValid} onClick={handleDelete}>
{t('modals.auth.profile.delete-account.actions.delete')}
{t<string>('modals.auth.profile.delete-account.actions.delete')}
</Button>
</div>
</div>
+7 -2
View File
@@ -57,12 +57,17 @@ const WorkModal: React.FC = () => {
const isEditMode = useMemo(() => !!item, [item]);
const addText = useMemo(
() => t<string>('builder.common.actions.add', { token: t<string>(`builder.leftSidebar.${path}.heading`, heading) }),
() =>
t<string>('builder.common.actions.add', {
token: t<string>(`builder.leftSidebar.${path}.heading`, { defaultValue: heading }),
}),
[t, heading]
);
const editText = useMemo(
() =>
t<string>('builder.common.actions.edit', { token: t<string>(`builder.leftSidebar.${path}.heading`, heading) }),
t<string>('builder.common.actions.edit', {
token: t<string>(`builder.leftSidebar.${path}.heading`, { defaultValue: heading }),
}),
[t, heading]
);