From a2970e8750aae57b99759f803c60f914cea19216 Mon Sep 17 00:00:00 2001 From: storywithoutend Date: Wed, 20 Sep 2023 12:46:09 +0800 Subject: [PATCH] fix type errors --- public/locales/en/transactionFlow.json | 3 ++- src/transaction-flow/input/EditRoles/EditRoles.test.tsx | 2 +- .../views/MainView/components/NoneSetAvatarWithIdentifier.tsx | 4 +++- src/transaction-flow/input/SyncManager/SyncManager-flow.tsx | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/public/locales/en/transactionFlow.json b/public/locales/en/transactionFlow.json index 76ae909dc..e7c5b5257 100644 --- a/public/locales/en/transactionFlow.json +++ b/public/locales/en/transactionFlow.json @@ -198,7 +198,8 @@ "editRoles": { "views": { "main": { - "title": "Edit roles" + "title": "Edit roles", + "noneSet": "None set" }, "editRole": { "title": "Change {{role}}", diff --git a/src/transaction-flow/input/EditRoles/EditRoles.test.tsx b/src/transaction-flow/input/EditRoles/EditRoles.test.tsx index 32a93266e..c9b5bb9ec 100644 --- a/src/transaction-flow/input/EditRoles/EditRoles.test.tsx +++ b/src/transaction-flow/input/EditRoles/EditRoles.test.tsx @@ -169,6 +169,6 @@ describe('EditRoles', () => { // Eth-record remove await userEvent.click(within(screen.getByTestId('role-card-eth-record')).getByTestId('role-card-change-button')) await userEvent.click(screen.getByRole('button', {name: 'action.remove'})) - expect(within(screen.getByTestId('role-card-eth-record')).getByText('None set')).toBeVisible() + expect(within(screen.getByTestId('role-card-eth-record')).getByText('input.editRoles.views.main.noneSet')).toBeVisible() }) }) \ No newline at end of file diff --git a/src/transaction-flow/input/EditRoles/views/MainView/components/NoneSetAvatarWithIdentifier.tsx b/src/transaction-flow/input/EditRoles/views/MainView/components/NoneSetAvatarWithIdentifier.tsx index 2779489bf..f2ac8f676 100644 --- a/src/transaction-flow/input/EditRoles/views/MainView/components/NoneSetAvatarWithIdentifier.tsx +++ b/src/transaction-flow/input/EditRoles/views/MainView/components/NoneSetAvatarWithIdentifier.tsx @@ -1,3 +1,4 @@ +import { useTranslation } from 'react-i18next' import styled, { css } from 'styled-components' import { Space, Typography, mq } from '@ensdomains/thorin' @@ -44,10 +45,11 @@ type Props = { } export const NoneSetAvatarWithIdentifier = ({ dirty = false, size = '10' }: Props) => { + const { t } = useTranslation('transactionFlow') return ( - None set + {t('input.editRoles.views.main.noneSet')} ) } diff --git a/src/transaction-flow/input/SyncManager/SyncManager-flow.tsx b/src/transaction-flow/input/SyncManager/SyncManager-flow.tsx index c9bba3592..6730d77cf 100644 --- a/src/transaction-flow/input/SyncManager/SyncManager-flow.tsx +++ b/src/transaction-flow/input/SyncManager/SyncManager-flow.tsx @@ -38,7 +38,9 @@ const SyncManager = ({ data: { name }, dispatch, onDismiss }: Props) => { const baseCanSynManager = checkCanSyncManager({ address: account.address, nameType: nameType.data, - details, + registrant: details.ownerData?.registrant, + owner: details.ownerData?.owner, + dnsOwner: details.dnsOwner, }) const syncType = nameType.data?.startsWith('dns') ? 'dns' : 'eth'