Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { type FC, useMemo } from 'react';
import { InlineLoader } from 'shared/components';
import { FormatToken } from 'shared/formatters';
import { isBigint } from 'utils';
import { WEI_PER_ETHER } from 'consts/tx';

import { ContentText } from './styles';

Expand All @@ -14,14 +15,18 @@ export interface ItemValueProps {
textSize?: 'lg' | 'xl';
}

const countMaxDecimalDigits = (amount: bigint) => {
return amount / WEI_PER_ETHER > 1000 ? 1 : 4;
};

export const OverviewItemValue: FC<ItemValueProps> = (props) => {
const { content, isLoading, color, textSize = 'xl', symbol = '' } = props;
const contentView = useMemo(
() =>
isBigint(content) ? (
<FormatToken
amount={content}
maxDecimalDigits={4}
maxDecimalDigits={countMaxDecimalDigits(content)}
showAmountTip={false}
symbol={symbol}
/>
Expand Down
2 changes: 1 addition & 1 deletion shared/components/layout/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const LayoutStyles = styled(Container)<{ isError: boolean }>`
min-height: 100vh;
height: auto;

@media ${devicesHeaderMedia.tablet} {
@media ${devicesHeaderMedia.laptop} {
grid-template-columns: 200px 1fr;
grid-template-areas: ${({ isError }) =>
tabletTemplateAreas[isError ? 'withError' : 'default']};
Expand Down
1 change: 1 addition & 0 deletions styles/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const NAV_MOBILE_HEIGHT = 60;
export const NAV_MOBILE_MAX_WIDTH = 880;
export const NAV_TABLET_MAX_WIDTH = 1024;
export const NAV_LAPTOP_MAX_WIDTH = 1200;
2 changes: 2 additions & 0 deletions styles/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { createGlobalStyle } from 'styled-components';
import { ThemeName } from '@lidofinance/lido-ui';

import {
NAV_LAPTOP_MAX_WIDTH,
NAV_MOBILE_HEIGHT,
NAV_MOBILE_MAX_WIDTH,
NAV_TABLET_MAX_WIDTH,
} from './constants';

export const devicesHeaderMedia = {
laptop: `screen and (max-width: ${NAV_LAPTOP_MAX_WIDTH}px)`,
tablet: `screen and (max-width: ${NAV_TABLET_MAX_WIDTH}px)`,
mobile: `screen and (max-width: ${NAV_MOBILE_MAX_WIDTH}px)`,
};
Expand Down
Loading