Skip to content

Commit

Permalink
fix incorrect displays
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Sep 4, 2024
1 parent a977ca3 commit 07ce595
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions src/components/pages/profile/[name]/tabs/MoreTab/NameWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ export const NameWrapper = ({
}: Props) => {
const { t } = useTranslation('profile')

const isPCCBurned = !!wrapperData?.fuses.parent?.PARENT_CANNOT_CONTROL

const cannotUnwrap = !!wrapperData?.fuses.child.CANNOT_UNWRAP

const status = getFuseStateFromWrapperData(wrapperData)

const isManager = ownerData?.owner === address
Expand All @@ -126,7 +122,7 @@ export const NameWrapper = ({
<Typography fontVariant="headingFour">{t('tabs.more.token.nameWrapper')}</Typography>
{isButtonDisplayed ? (
isWrapped ? (
cannotUnwrap ? (
status === 'locked' ? (
<DisabledButtonWithTooltip
buttonText={t('tabs.more.token.unwrap')}
content={t('tabs.more.token.unwrapWarning')}
Expand All @@ -150,17 +146,26 @@ export const NameWrapper = ({
{isWrapped
? t('tabs.more.token.status.wrapped')
: t('tabs.more.token.status.unwrapped')}

{status === 'locked' ? <LockSVG /> : null}
</Record>
<ParentControlRecord
data-testid="pcc-status"
$cannotUnwrap={cannotUnwrap}
$isPCCBurned={isPCCBurned}
>
{isPCCBurned
? t('tabs.more.token.pcc.not-controllable')
: t('tabs.more.token.pcc.controllable')}
{cannotUnwrap ? <LockSVG /> : isPCCBurned ? <CheckSVG /> : <AlertSVG />}
</ParentControlRecord>
{isWrapped ? (
<ParentControlRecord
data-testid="pcc-status"
$cannotUnwrap={status === 'locked'}
$isPCCBurned={status === 'emancipated'}
>
{status === 'emancipated' ? (
<>
{t('tabs.more.token.pcc.not-controllable')} <CheckSVG />
</>
) : (
<>
{t('tabs.more.token.pcc.controllable')} <AlertSVG />
</>
)}
</ParentControlRecord>
) : null}
</TwoRows>
)}
</Container>
Expand Down

0 comments on commit 07ce595

Please sign in to comment.