Skip to content

Commit

Permalink
fixup! feat(suite-native): use crypto icon with network
Browse files Browse the repository at this point in the history
  • Loading branch information
vytick committed Feb 7, 2025
1 parent 13c9d5b commit b841001
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const AccountsListItem = ({
const icon = useMemo(
() =>
isNativeCoinOnly ? (
<CryptoIconWithNetwork symbol={account.symbol} preferNetworkSymbol={false} />
<CryptoIconWithNetwork symbol={account.symbol} />
) : (
<RoundedIcon symbol={account.symbol} />
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ type AccountDetailNavigationProps = StackToStackCompositeNavigationProps<
RootStackParamList
>;

const AccountDetailScreenHeaderContent = ({
accountLabel,
accountKey,
}: AccountDetailScreenHeaderProps) => {
const symbol = useSelector((state: AccountsRootState) =>
selectAccountNetworkSymbol(state, accountKey),
)!;

return (
<HStack alignItems="center">
<CryptoIconWithNetwork symbol={symbol} size="small" />
<Text variant="highlight" adjustsFontSizeToFit numberOfLines={1}>
{accountLabel}
</Text>
</HStack>
);
};

export const AccountDetailScreenHeader = ({
accountLabel,
accountKey,
Expand All @@ -33,9 +51,6 @@ export const AccountDetailScreenHeader = ({
const route = useRoute<RouteProp<RootStackParamList, RootStackRoutes.AccountDetail>>();
const { closeActionType } = route.params;

const symbol = useSelector((state: AccountsRootState) =>
selectAccountNetworkSymbol(state, accountKey),
)!;
const handleSettingsNavigation = () => {
navigation.navigate(RootStackRoutes.AccountSettings, {
accountKey,
Expand All @@ -45,14 +60,10 @@ export const AccountDetailScreenHeader = ({
return (
<ScreenHeader
content={
<HStack alignItems="center">
<CryptoIconWithNetwork
symbol={symbol}
size="small"
preferNetworkSymbol={false}
/>
<Text>{accountLabel}</Text>
</HStack>
<AccountDetailScreenHeaderContent
accountLabel={accountLabel}
accountKey={accountKey}
/>
}
rightIcon={
<IconButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const CoinPriceCard = ({ accountKey }: CoinPriceCardProps) => {
<Card style={applyStyle(cardStyle)}>
<Box flexDirection="row" alignItems="center" flex={1}>
<Box marginRight="sp16">
<CryptoIconWithNetwork symbol={symbol} preferNetworkSymbol={false} />
<CryptoIconWithNetwork symbol={symbol} />
</Box>
<Box style={applyStyle(cardContentStyle)}>
<Text variant="label" color="textSubdued">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import {

import { AccountDetailCryptoValue } from './AccountDetailCryptoValue';
import { AccountDetailGraph } from './AccountDetailGraph';
import { selectIsNetworkSendFlowEnabled } from '../selectors';
import { CoinPriceCard } from './CoinPriceCard';
import { selectIsNetworkSendFlowEnabled } from '../selectors';

type TransactionListHeaderProps = {
accountKey: AccountKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export const TransactionDetailAddressesSection = ({
symbol={symbol}
contractAddress={contractAddress}
size="small"
preferNetworkSymbol={false}
/>
)}
</Box>
Expand Down

0 comments on commit b841001

Please sign in to comment.