Skip to content

Commit

Permalink
Public tags design updates (#2078)
Browse files Browse the repository at this point in the history
* update styles of name tags

* update screenshots

* update screenshots

* fix tests

* update screenshot
  • Loading branch information
tom2drum authored Jul 18, 2024
1 parent 6f7c284 commit 6000e9c
Show file tree
Hide file tree
Showing 85 changed files with 37 additions and 13 deletions.
3 changes: 3 additions & 0 deletions icons/link_external.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/icons/name.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
| "key"
| "lightning_navbar"
| "lightning"
| "link_external"
| "link"
| "lock"
| "minus"
Expand Down
4 changes: 4 additions & 0 deletions theme/foundations/semanticTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const semanticTokens = {
link_hovered: {
'default': 'blue.400',
},
icon_link_external: {
'default': 'gray.300',
_dark: 'gray.500',
},
icon_info: {
'default': 'gray.400',
_dark: 'gray.500',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions ui/marketplace/MarketplaceAppIntegrationIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,24 @@ type Props = {
}

const MarketplaceAppIntegrationIcon = ({ external, internalWallet }: Props) => {
const [ icon, iconColor, text ] = React.useMemo(() => {
const [ icon, iconColor, text, boxSize ] = React.useMemo(() => {
let icon: IconName = 'integration/partial';
let color = 'gray.400';
let text = 'This app opens in Blockscout without Blockscout wallet functionality. Use your external web3 wallet to connect directly to this application';
let boxSize = 5;

if (external) {
icon = 'arrows/north-east';
icon = 'link_external';
color = 'icon_link_external';
text = 'This app opens in a separate tab';
boxSize = 4;
} else if (internalWallet) {
icon = 'integration/full';
color = 'green.500';
text = 'This app opens in Blockscout and your Blockscout wallet connects automatically';
}

return [ icon, color, text ];
return [ icon, color, text, boxSize ];
}, [ external, internalWallet ]);

return (
Expand All @@ -37,7 +40,7 @@ const MarketplaceAppIntegrationIcon = ({ external, internalWallet }: Props) => {
>
<IconSvg
name={ icon }
boxSize={ 5 }
boxSize={ boxSize }
color={ iconColor }
position="relative"
cursor="pointer"
Expand Down
4 changes: 4 additions & 0 deletions ui/pages/Address.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const hooksConfig = {
},
};

test.beforeEach(async({ mockTextAd }) => {
await mockTextAd();
});

test.describe('fetched bytecode', () => {
test('should refetch address query', async({ render, mockApiResponse, createSocket, page }) => {
const addressApiUrl = await mockApiResponse('address', addressMock.validator, { pathParams: { hash: addressMock.hash } });
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/Marketplace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const Marketplace = () => {
<MenuItem key={ label } as="a" href={ href } target="_blank" py={ 2 } px={ 4 }>
<IconSvg name={ icon } boxSize={ 4 } mr={ 2.5 }/>
{ label }
<IconSvg name="arrows/north-east" boxSize={ 4 } color="gray.400" ml={ 2 }/>
<IconSvg name="link_external" boxSize={ 3 } color="icon_link_external" ml={ 2 }/>
</MenuItem>
)) }
</MenuList>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ui/shared/EntityTags/EntityTagPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const EntityTagPopover = ({ data, children }: Props) => {
<PopoverTrigger>
{ children }
</PopoverTrigger>
<PopoverContent bgColor={ bgColor } borderRadius="sm" maxW="300px" w="fit-content">
<PopoverContent bgColor={ bgColor } borderRadius="sm" maxW="280px" w="fit-content">
<PopoverArrow bgColor={ bgColor }/>
<DarkMode>
<PopoverBody color="white" p={ 2 } fontSize="sm" display="flex" flexDir="column" rowGap={ 2 }>
Expand Down
6 changes: 3 additions & 3 deletions ui/shared/links/LinkExternal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ const LinkExternal = ({ href, children, className, isLoading, variant, iconColor
return (
<Skeleton className={ className } { ...styleProps } bgColor="inherit">
{ children }
<Box boxSize={ 4 } display="inline-block"/>
<Box boxSize={ 3 } display="inline-block"/>
</Skeleton>
);
}

return (
<Box className={ className } { ...styleProps }>
{ children }
<Skeleton boxSize={ 4 } verticalAlign="middle" display="inline-block"/>
<Skeleton boxSize={ 3 } verticalAlign="middle" display="inline-block"/>
</Box>
);
}

return (
<Link className={ className } { ...styleProps } target="_blank" href={ href } onClick={ onClick }>
{ children }
<IconSvg name="arrows/north-east" boxSize={ 4 } verticalAlign="middle" color={ iconColor ?? 'gray.400' } flexShrink={ 0 }/>
<IconSvg name="link_external" boxSize={ 3 } verticalAlign="middle" color={ iconColor ?? 'icon_link_external' } flexShrink={ 0 }/>
</Link>
);
};
Expand Down
2 changes: 1 addition & 1 deletion ui/snippets/navigation/vertical/NavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const NavLink = ({ item, isCollapsed, px, className, onClick, disableActiveState
<NavLinkIcon item={ item }/>
<Text { ...styleProps.textProps } as="span" ml={ 3 }>
<span>{ item.text }</span>
{ !isInternalLink && <IconSvg name="arrows/north-east" boxSize={ 4 } color="text_secondary" verticalAlign="middle"/> }
{ !isInternalLink && <IconSvg name="link_external" boxSize={ 3 } color="icon_link_external" verticalAlign="middle"/> }
</Text>
{ isHighlighted && (
<LightningLabel iconColor={ styleProps.itemProps.bgColor } isCollapsed={ isCollapsed }/>
Expand Down
12 changes: 10 additions & 2 deletions ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggestApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const SearchBarSuggestApp = ({ data, isMobile, searchTerm, onClick }: Props) =>
>
<span dangerouslySetInnerHTML={{ __html: highlightText(data.title, searchTerm) }}/>
</Text>
{ data.external && <IconSvg name="arrows/north-east" boxSize={ 4 } verticalAlign="middle" flexShrink={ 0 }/> }
{ data.external && <IconSvg name="link_external" color="icon_link_external" boxSize={ 3 } verticalAlign="middle" flexShrink={ 0 }/> }
</Flex>
<Text
variant="secondary"
Expand Down Expand Up @@ -81,7 +81,15 @@ const SearchBarSuggestApp = ({ data, isMobile, searchTerm, onClick }: Props) =>
>
{ data.description }
</Text>
{ data.external && <IconSvg name="arrows/north-east" boxSize={ 4 } verticalAlign="middle" color="text_secondary" flexShrink={ 0 }/> }
{ data.external && (
<IconSvg
name="link_external"
color="icon_link_external"
boxSize={ 3 }
verticalAlign="middle"
flexShrink={ 0 }
/>
) }
</Flex>
);
})();
Expand Down
3 changes: 2 additions & 1 deletion ui/tokenInstance/TokenInstanceDetails.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ test.beforeEach(async({ mockApiResponse, mockAssetResponse }) => {
await mockApiResponse('address', addressMock.contract, { pathParams: { hash } });
await mockApiResponse('token_instance_transfers_count', { transfers_count: 42 }, { pathParams: { id: tokenInstanceMock.unique.id, hash } });
await mockAssetResponse('http://localhost:3000/nft-marketplace-logo.png', './playwright/mocks/image_s.jpg');
await mockAssetResponse(tokenInstanceMock.unique.image_url as string, './playwright/mocks/image_md.jpg');
});

test('base view +@dark-mode +@mobile', async({ render, page }) => {
const component = await render(
<MetadataUpdateProvider>
<TokenInstanceDetails data={ tokenInstanceMock.unique } token={ tokenInfoERC721a }/>
<TokenInstanceDetails data={{ ...tokenInstanceMock.unique, image_url: null }} token={ tokenInfoERC721a }/>
</MetadataUpdateProvider>,
);
await expect(component).toHaveScreenshot({
Expand Down

0 comments on commit 6000e9c

Please sign in to comment.