Skip to content

Commit

Permalink
fix(suite): remove useless HiddenPlaceholder code
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemonexe committed Dec 10, 2024
1 parent 58681b6 commit 066d753
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
8 changes: 1 addition & 7 deletions packages/suite/src/components/suite/FiatValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ import { HiddenPlaceholder } from 'src/components/suite';

import { HiddenPlaceholderProps } from './HiddenPlaceholder';

const StyledHiddenPlaceholder = styled((props: HiddenPlaceholderProps) => (
<HiddenPlaceholder {...props} />
))`
font-variant-numeric: tabular-nums;
`;

// Do NOT use any prop from <HiddenPlaceholderProps>, its here just to fix types
const SameWidthNums = styled.span<HiddenPlaceholderProps>`
font-variant-numeric: tabular-nums;
Expand Down Expand Up @@ -86,7 +80,7 @@ export const FiatValue = ({
const { FiatAmountFormatter } = useFormatters();
const value = shouldConvert ? fiatAmount : amount;

const WrapperComponent = disableHiddenPlaceholder ? SameWidthNums : StyledHiddenPlaceholder;
const WrapperComponent = disableHiddenPlaceholder ? SameWidthNums : HiddenPlaceholder;

const isTokenKnown = useSelector(state =>
selectIsSpecificCoinDefinitionKnown(state, symbol, tokenAddress || ('' as TokenAddress)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ import { Card, Icon, Tooltip, Row, Column, Text, Divider } from '@trezor/compone
import { getAllAccounts, getTotalFiatBalance } from '@suite-common/wallet-utils';
import { spacings, negativeSpacings } from '@trezor/theme';

import {
WalletLabeling,
Translation,
MetadataLabeling,
HiddenPlaceholder,
} from 'src/components/suite';
import { WalletLabeling, Translation, MetadataLabeling } from 'src/components/suite';
import { useDispatch, useSelector } from 'src/hooks/suite';
import { AcquiredDevice, ForegroundAppProps } from 'src/types/suite';
import { selectLabelingDataForWallet } from 'src/reducers/suite/metadataReducer';
Expand Down Expand Up @@ -163,13 +158,11 @@ export const WalletInstance = ({
</Row>
</Text>

<HiddenPlaceholder>
<FiatHeader
amount={instanceBalance.toString()}
size="medium"
localCurrency={localCurrency}
/>
</HiddenPlaceholder>
<FiatHeader
amount={instanceBalance.toString()}
size="medium"
localCurrency={localCurrency}
/>
</Column>

{(isViewOnlyRendered ||
Expand Down

0 comments on commit 066d753

Please sign in to comment.