Skip to content

Commit 06ad1da

Browse files
authored
testnet label and network logo fixes (#3153)
* testnet label and network logo fixes * fix tests
1 parent ceaeca4 commit 06ad1da

File tree

69 files changed

+212
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+212
-141
lines changed

toolkit/chakra/image.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ import { Skeleton } from './skeleton';
66

77
export interface ImageProps extends ChakraImageProps {
88
fallback?: React.ReactNode;
9+
// for the case where the image dimensions are not known before the image is loaded
10+
skeletonWidth?: BoxProps['width'];
11+
skeletonHeight?: BoxProps['height'];
912
}
1013

1114
export const Image = React.forwardRef<HTMLImageElement, ImageProps>(
1215
function Image(props, ref) {
13-
const { fallback, src, onLoad, onError, ...rest } = props;
16+
const { fallback, src, onLoad, onError, skeletonWidth, skeletonHeight, ...rest } = props;
1417

1518
const [ loading, setLoading ] = React.useState(true);
1619
const [ error, setError ] = React.useState(false);
@@ -40,9 +43,15 @@ export const Image = React.forwardRef<HTMLImageElement, ImageProps>(
4043
return fallback;
4144
}
4245

46+
const skeletonProps: BoxProps = {
47+
...rest as BoxProps,
48+
...(skeletonWidth !== undefined && { width: skeletonWidth }),
49+
...(skeletonHeight !== undefined && { height: skeletonHeight }),
50+
};
51+
4352
return (
4453
<>
45-
{ loading && <Skeleton loading { ...rest as BoxProps }/> }
54+
{ loading && <Skeleton loading { ...skeletonProps }/> }
4655
<ChakraImage
4756
ref={ ref }
4857
src={ src }

ui/marketplace/MarketplaceAppTopBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Link } from 'toolkit/chakra/link';
1313
import { BackToButton } from 'toolkit/components/buttons/BackToButton';
1414
import { makePrettyLink } from 'toolkit/utils/url';
1515
import RewardsButton from 'ui/rewards/RewardsButton';
16-
import NetworkLogo from 'ui/snippets/networkMenu/NetworkLogo';
16+
import NetworkIcon from 'ui/snippets/networkLogo/NetworkIcon';
1717
import UserProfileDesktop from 'ui/snippets/user/profile/UserProfileDesktop';
1818
import UserWalletDesktop from 'ui/snippets/user/wallet/UserWalletDesktop';
1919

@@ -43,7 +43,7 @@ const MarketplaceAppTopBar = ({ appId, data, isLoading }: Props) => {
4343

4444
return (
4545
<Flex alignItems="center" mb={{ base: 3, md: 2 }} rowGap={ 3 } columnGap={ 2 }>
46-
{ !isMobile && <NetworkLogo isCollapsed mr={ 4 }/> }
46+
{ !isMobile && <NetworkIcon mr={ 4 }/> }
4747
<BackToButton
4848
href={ goBackUrl }
4949
hint="Back to dApps list"
22 Bytes
-949 Bytes

ui/snippets/header/Burger.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import IconSvg from 'ui/shared/IconSvg';
77
import NavigationMobile from 'ui/snippets/navigation/mobile/NavigationMobile';
88
import RollupStageBadge from 'ui/snippets/navigation/RollupStageBadge';
99
import TestnetBadge from 'ui/snippets/navigation/TestnetBadge';
10-
import NetworkLogo from 'ui/snippets/networkMenu/NetworkLogo';
10+
import NetworkLogo from 'ui/snippets/networkLogo/NetworkLogo';
1111

1212
interface Props {
1313
isMarketplaceAppPage?: boolean;
@@ -35,8 +35,8 @@ const Burger = ({ isMarketplaceAppPage }: Props) => {
3535
</DrawerTrigger>
3636
<DrawerContent >
3737
<DrawerBody display="flex" flexDirection="column" overflowX="hidden" overflowY="auto">
38-
<TestnetBadge alignSelf="flex-start"/>
39-
<RollupStageBadge alignSelf="flex-start"/>
38+
<TestnetBadge alignSelf="flex-start" mb={ 2 }/>
39+
<RollupStageBadge alignSelf="flex-start" mb={ 2 }/>
4040
<NetworkLogo/>
4141
<NavigationMobile onNavLinkClick={ onClose } isMarketplaceAppPage={ isMarketplaceAppPage }/>
4242
</DrawerBody>

ui/snippets/header/HeaderMobile.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import React from 'react';
44
import config from 'configs/app';
55
import { useIsSticky } from 'toolkit/hooks/useIsSticky';
66
import RewardsButton from 'ui/rewards/RewardsButton';
7-
import NetworkLogo from 'ui/snippets/networkMenu/NetworkLogo';
7+
import NetworkIcon from 'ui/snippets/networkLogo/NetworkIcon';
88
import UserProfileMobile from 'ui/snippets/user/profile/UserProfileMobile';
99
import UserWalletMobile from 'ui/snippets/user/wallet/UserWalletMobile';
1010

11+
import RollupStageBadge from '../navigation/RollupStageBadge';
12+
import TestnetBadge from '../navigation/TestnetBadge';
1113
import SearchBarMobile from '../searchBar/SearchBarMobile';
1214
import Burger from './Burger';
1315

@@ -44,7 +46,11 @@ const HeaderMobile = ({ hideSearchButton, onGoToSearchResults }: Props) => {
4446
boxShadow={ isSticky ? 'md' : 'none' }
4547
>
4648
<Burger/>
47-
<NetworkLogo ml={ 2 } mr="auto"/>
49+
<Flex alignItems="center" flexGrow={ 1 } mx={ 2 }>
50+
<NetworkIcon/>
51+
<TestnetBadge ml={ 2 }/>
52+
<RollupStageBadge ml={ 2 }/>
53+
</Flex>
4854
<Flex columnGap={ 2 }>
4955
{ !hideSearchButton && <SearchBarMobile onGoToSearchResults={ onGoToSearchResults }/> }
5056
{ config.features.rewards.isEnabled && <RewardsButton/> }
9 Bytes
3 Bytes
0 Bytes
5 Bytes

0 commit comments

Comments
 (0)