Skip to content

Commit

Permalink
Fix highlighted text in ConsensusAccountLink
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Nov 13, 2024
1 parent de35c66 commit a9c936d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
12 changes: 11 additions & 1 deletion src/app/components/Account/ConsensusAccountLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,27 @@ type ConsensusAccountLinkProps = {
alwaysTrim?: boolean
labelOnly?: boolean
network: Network
highlightedPartOfName?: string | undefined
}

export const ConsensusAccountLink: FC<ConsensusAccountLinkProps> = ({
address,
alwaysTrim = true,
labelOnly,
network,
highlightedPartOfName,
}) => {
const { data } = useGetConsensusValidatorsAddressNameMap(network)

if (data?.data?.[address]) {
return <ValidatorLink address={address} network={network} alwaysTrim={alwaysTrim} />
return (
<ValidatorLink
address={address}
network={network}
alwaysTrim={alwaysTrim}
highlightedPartOfName={highlightedPartOfName}
/>
)
}

return (
Expand All @@ -29,6 +38,7 @@ export const ConsensusAccountLink: FC<ConsensusAccountLinkProps> = ({
scope={{ network, layer: Layer.consensus }}
address={address}
alwaysTrim={alwaysTrim}
highlightedPartOfName={highlightedPartOfName}
/>
)
}
2 changes: 1 addition & 1 deletion src/app/components/Validators/DeferredValidatorLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const DeferredValidatorLink: FC<{
address={address}
network={scope.network}
name={validator?.media?.name}
highlightedPart={highlightedPart}
highlightedPartOfName={highlightedPart}
/>
)
}
8 changes: 4 additions & 4 deletions src/app/components/Validators/ValidatorLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ type ValidatorLinkProps = {
name?: string
network: Network
alwaysTrim?: boolean
highlightedPart?: string
highlightedPartOfName?: string
}

export const ValidatorLink: FC<ValidatorLinkProps> = ({
address,
name,
network,
alwaysTrim,
highlightedPart,
highlightedPartOfName,
}) => {
const { isTablet } = useScreenSize()
const to = RouteUtils.getValidatorRoute(network, address)
Expand All @@ -36,15 +36,15 @@ export const ValidatorLink: FC<ValidatorLinkProps> = ({
address={address}
name={name || validatorName}
to={to}
highlightedPart={highlightedPart}
highlightedPart={highlightedPartOfName}
/>
) : (
<DesktopValidatorLink
address={address}
alwaysTrim={alwaysTrim}
name={name || validatorName}
to={to}
highlightedPart={highlightedPart}
highlightedPart={highlightedPartOfName}
/>
)}
</Typography>
Expand Down

0 comments on commit a9c936d

Please sign in to comment.