Skip to content

Commit

Permalink
fix: Fix the Monthly Active Accounts table style (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinoosss committed Aug 23, 2023
1 parent 81f0e52 commit 37c7789
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
28 changes: 15 additions & 13 deletions src/components/ui/text/amount-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,21 @@ export const AmountText = ({

return (
<Wrapper className={className}>
{num && (
<>
<Text className="text-wrapper" type={maxSize} color={color} display="contents">
{num[0]}
</Text>
<Text type={minSize} color={color} display="contents" className="decimals">
{decimalValue(num)}
</Text>
<Text type={maxSize} color={color} display="contents">
{denom}
</Text>
</>
)}
<div className="amount-wrapper">
{num && (
<>
<Text className="text-wrapper" type={maxSize} color={color} display="contents">
{num[0]}
</Text>
<Text type={minSize} color={color} display="contents" className="decimals">
{decimalValue(num)}
</Text>
<Text type={maxSize} color={color} display="contents">
{denom}
</Text>
</>
)}
</div>
</Wrapper>
);
};
Expand Down
17 changes: 15 additions & 2 deletions src/components/view/main-active-list/main-active-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ActiveBoards from './active-boards';
import Text from '@/components/ui/text';
import {AmountText} from '@/components/ui/text/amount-text';
import {TextProps} from '@/components/ui/text/text';
import {PaletteKeyType} from '@/styles';

interface StyledTextProps extends TextProps {
width?: string;
Expand Down Expand Up @@ -101,10 +102,22 @@ export const StyledText = styled(Text)<StyledTextProps>`
${textStyle};
`;

export const StyledAmountText = styled(AmountText)<{width?: string}>`
export const StyledAmountText = styled(AmountText)<{width?: string; color?: PaletteKeyType}>`
min-width: ${({width}) => width};
max-width: ${({width}) => width};
${textStyle};
${textStyle}
& .amount-wrapper {
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: ${({theme, color}) => theme.colors[color ?? 'reverse']};
& * {
display: inline;
white-space: nowrap;
}
}
`;

export const FitContentA = styled.a`
Expand Down

0 comments on commit 37c7789

Please sign in to comment.