diff --git a/src/components/pages/profile/[name]/tabs/OwnershipTab/sections/RolesSection/components/RoleTag.tsx b/src/components/pages/profile/[name]/tabs/OwnershipTab/sections/RolesSection/components/RoleTag.tsx index 05ec74e60..e95b41bb1 100644 --- a/src/components/pages/profile/[name]/tabs/OwnershipTab/sections/RolesSection/components/RoleTag.tsx +++ b/src/components/pages/profile/[name]/tabs/OwnershipTab/sections/RolesSection/components/RoleTag.tsx @@ -1,5 +1,4 @@ import { TOptions } from 'i18next' -import { useState } from 'react' import { useTranslation } from 'react-i18next' import styled, { css } from 'styled-components' @@ -63,12 +62,10 @@ export const RoleTag = ({ const _role = isEmancipated && role === 'owner' ? 'owner-emancipated' : role const tOptions: TOptions = role === 'parent-owner' ? { parent: parentName(name) } : {} const link = getSupportLink(_role) - const [open, setOpen] = useState() return ( setOpen(undefined)}> + {t(`tabs.ownership.tooltips.${_role}`, tOptions)} @@ -85,11 +82,7 @@ export const RoleTag = ({ } background="indigoSurface" > - setOpen((_open) => (_open ? undefined : true))} - > + {t(`roles.${role}.title`, { ns: 'common' })} diff --git a/src/hooks/useNameType.test.ts b/src/hooks/useNameType.test.ts index 7dd29b2a9..04fa9fb03 100644 --- a/src/hooks/useNameType.test.ts +++ b/src/hooks/useNameType.test.ts @@ -6,6 +6,10 @@ jest.mock('@app/hooks/useBasicName', () => ({ useBasicName: () => mockBasicData() })) +jest.mock('@app/hooks/useContractAddress', () => ({ + useContractAddress: () => '0xnamewrapper' +})) + describe('useNameType', () => { describe('name level', () => { it('should return root', async () => { @@ -49,7 +53,7 @@ describe('useNameType', () => { it('should return 2ld', async () => { mockBasicData.mockReturnValue({ ownerData: { - ownershipLevel: 'namewrapper' + ownershipLevel: 'nameWrapper' }, wrapperData: { child: { @@ -68,7 +72,7 @@ describe('useNameType', () => { it('should return dns type', async () => { mockBasicData.mockReturnValue({ ownerData: { - ownershipLevel: 'namewrapper' + ownershipLevel: 'nameWrapper' }, wrapperData: { child: { diff --git a/src/hooks/useNameType.ts b/src/hooks/useNameType.ts index d6dbe571f..4505eae6d 100644 --- a/src/hooks/useNameType.ts +++ b/src/hooks/useNameType.ts @@ -37,6 +37,7 @@ const getWrapLevel = ( wrapperData: ReturnType['wrapperData'], ownerData: ReturnType['ownerData'], ) => { + if (ownerData?.ownershipLevel !== 'nameWrapper') return 'unwrapped' if (wrapperData?.child.CANNOT_UNWRAP) return 'locked' as const if (wrapperData?.parent.PARENT_CANNOT_CONTROL) return 'emancipated' as const if (ownerData?.ownershipLevel === 'nameWrapper') return 'wrapped' as const