Commit 1561c0d0 authored by lynn's avatar lynn Committed by GitHub

feat: fix visual bugs on truncate token description (#4462)

init
parent 1f740cf8
...@@ -124,6 +124,7 @@ export const TopArea = styled.div` ...@@ -124,6 +124,7 @@ export const TopArea = styled.div`
` `
export const ResourcesContainer = styled.div` export const ResourcesContainer = styled.div`
display: flex; display: flex;
padding-top: 12px;
gap: 14px; gap: 14px;
` `
const NetworkBadge = styled.div<{ networkColor?: string; backgroundColor?: string }>` const NetworkBadge = styled.div<{ networkColor?: string; backgroundColor?: string }>`
...@@ -188,7 +189,7 @@ const TruncateDescriptionButton = styled.div` ...@@ -188,7 +189,7 @@ const TruncateDescriptionButton = styled.div`
color: ${({ theme }) => theme.textSecondary}; color: ${({ theme }) => theme.textSecondary};
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 14px;
padding: 14px 0px; padding-top: 14px;
&:hover, &:hover,
&:focus { &:focus {
...@@ -234,16 +235,18 @@ export function AboutSection({ address, tokenDetailData }: { address: string; to ...@@ -234,16 +235,18 @@ export function AboutSection({ address, tokenDetailData }: { address: string; to
<AboutHeader> <AboutHeader>
<Trans>About</Trans> <Trans>About</Trans>
</AboutHeader> </AboutHeader>
{(!tokenDetailData || !tokenDetailData.description) && (
<NoInfoAvailable>
<Trans>No token information available</Trans>
</NoInfoAvailable>
)}
<TokenDescriptionContainer> <TokenDescriptionContainer>
{(!tokenDetailData || !tokenDetailData.description) && (
<NoInfoAvailable>
<Trans>No token information available</Trans>
</NoInfoAvailable>
)}
{tokenDescription} {tokenDescription}
<TruncateDescriptionButton onClick={() => setIsDescriptionTruncated(!isDescriptionTruncated)}> {shouldTruncate && (
{isDescriptionTruncated ? <Trans>Read more</Trans> : <Trans>Hide</Trans>} <TruncateDescriptionButton onClick={() => setIsDescriptionTruncated(!isDescriptionTruncated)}>
</TruncateDescriptionButton> {isDescriptionTruncated ? <Trans>Read more</Trans> : <Trans>Hide</Trans>}
</TruncateDescriptionButton>
)}
</TokenDescriptionContainer> </TokenDescriptionContainer>
<ResourcesContainer> <ResourcesContainer>
<Resource name={'Etherscan'} link={`https://etherscan.io/address/${address}`} /> <Resource name={'Etherscan'} link={`https://etherscan.io/address/${address}`} />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment