-
Notifications
You must be signed in to change notification settings - Fork 690
testnet label and network logo fixes #3153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+22 Bytes
(100%)
...rchResults/__screenshots__/SearchResults.pw.tsx_default_desktop-base-view-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-949 Bytes
(99%)
...archResults/__screenshots__/SearchResults.pw.tsx_default_mobile-base-view-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+9 Bytes
(100%)
...eenshots__/Burger.pw.tsx_dark-color-mode_with-promo-banner-text-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3 Bytes
(100%)
ui/snippets/header/__screenshots__/Burger.pw.tsx_default_auth-base-view-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
ui/snippets/header/__screenshots__/Burger.pw.tsx_default_base-view-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5 Bytes
(100%)
ui/snippets/header/__screenshots__/Burger.pw.tsx_default_dark-mode-base-view-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
ui/snippets/header/__screenshots__/Burger.pw.tsx_default_submenu-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10 Bytes
(100%)
...pets/header/__screenshots__/Burger.pw.tsx_default_with-promo-banner-image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7 Bytes
(100%)
...er/__screenshots__/Burger.pw.tsx_default_with-promo-banner-text-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-843 Bytes
(85%)
..._screenshots__/HeaderMobile.pw.tsx_dark-color-mode_default-view-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-912 Bytes
(84%)
...header/__screenshots__/HeaderMobile.pw.tsx_default_default-view-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-5 Bytes
(100%)
...creenshots__/NavigationDesktop.pw.tsx_dark-color-mode_base-view-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-34 Bytes
(100%)
...NavigationDesktop.pw.tsx_dark-color-mode_with-promo-banner-text-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-30 Bytes
(100%)
...ntal/__screenshots__/NavigationDesktop.pw.tsx_default_base-view-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+16 Bytes
(100%)
...zontal/__screenshots__/NavigationDesktop.pw.tsx_default_with-groped-items-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-212 Bytes
(98%)
.../__screenshots__/NavigationDesktop.pw.tsx_default_with-promo-banner-image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-191 Bytes
(99%)
...s__/NavigationDesktop.pw.tsx_default_with-promo-banner-image-with-tooltip-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-192 Bytes
(98%)
...shots__/NavigationDesktop.pw.tsx_default_with-promo-banner-text-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-97 Bytes
(100%)
...ts__/NavigationDesktop.pw.tsx_default_with-promo-banner-text-with-tooltip-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-13 Bytes
(100%)
.../__screenshots__/NavigationDesktop.pw.tsx_dark-color-mode_hover-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
...hots__/NavigationDesktop.pw.tsx_dark-color-mode_hover-xl-screen-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-13 Bytes
(100%)
..._screenshots__/NavigationDesktop.pw.tsx_dark-color-mode_no-auth-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
...ts__/NavigationDesktop.pw.tsx_dark-color-mode_no-auth-xl-screen-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+632 Bytes
(110%)
...avigationDesktop.pw.tsx_dark-color-mode_with-highlighted-routes-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+666 Bytes
(100%)
...esktop.pw.tsx_dark-color-mode_with-highlighted-routes-xl-screen-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+677 Bytes
(110%)
...NavigationDesktop.pw.tsx_dark-color-mode_with-promo-banner-text-dark-mode-1.png
Oops, something went wrong.
Binary file modified
BIN
+663 Bytes
(100%)
...Desktop.pw.tsx_dark-color-mode_with-promo-banner-text-xl-screen-dark-mode-1.png
Oops, something went wrong.
Binary file modified
BIN
-9 Bytes
(100%)
...vertical/__screenshots__/NavigationDesktop.pw.tsx_default_hover-dark-mode-1.png
Oops, something went wrong.
Binary file modified
BIN
-2 Bytes
(100%)
..._screenshots__/NavigationDesktop.pw.tsx_default_hover-xl-screen-dark-mode-1.png
Oops, something went wrong.
Binary file modified
BIN
+3 Bytes
(100%)
...rtical/__screenshots__/NavigationDesktop.pw.tsx_default_no-auth-dark-mode-1.png
Oops, something went wrong.
Binary file modified
BIN
-2 Bytes
(100%)
...creenshots__/NavigationDesktop.pw.tsx_default_no-auth-xl-screen-dark-mode-1.png
Oops, something went wrong.
Binary file modified
BIN
+626 Bytes
(110%)
...hots__/NavigationDesktop.pw.tsx_default_with-highlighted-routes-dark-mode-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
...s__/NavigationDesktop.pw.tsx_default_with-highlighted-routes-with-submenu-1.png
Oops, something went wrong.
Binary file modified
BIN
+623 Bytes
(100%)
...igationDesktop.pw.tsx_default_with-highlighted-routes-xl-screen-dark-mode-1.png
Oops, something went wrong.
Binary file modified
BIN
+563 Bytes
(100%)
.../__screenshots__/NavigationDesktop.pw.tsx_default_with-promo-banner-image-1.png
Oops, something went wrong.
Binary file modified
BIN
+604 Bytes
(100%)
...hots__/NavigationDesktop.pw.tsx_default_with-promo-banner-image-xl-screen-1.png
Oops, something went wrong.
Binary file modified
BIN
+639 Bytes
(110%)
...shots__/NavigationDesktop.pw.tsx_default_with-promo-banner-text-dark-mode-1.png
Oops, something went wrong.
Binary file modified
BIN
+622 Bytes
(100%)
...vigationDesktop.pw.tsx_default_with-promo-banner-text-xl-screen-dark-mode-1.png
Oops, something went wrong.
Binary file modified
BIN
+3 Bytes
(100%)
...l/__screenshots__/NavigationDesktop.pw.tsx_default_with-submenu-base-view-1.png
Oops, something went wrong.
Binary file modified
BIN
-3 Bytes
(100%)
...shots__/NavigationDesktop.pw.tsx_default_with-submenu-xl-screen-base-view-1.png
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| import type { Locator } from '@playwright/test'; | ||
| import React from 'react'; | ||
|
|
||
| import { test, expect } from 'playwright/lib'; | ||
|
|
||
| import NetworkIcon from './NetworkIcon'; | ||
|
|
||
| const ICON_URL = 'https://localhost:3000/my-icon.png'; | ||
|
|
||
| test.use({ viewport: { width: 30, height: 30 } }); | ||
|
|
||
| test.describe('placeholder icon', () => { | ||
| test.beforeEach(async({ mockEnvs }) => { | ||
| await mockEnvs([ | ||
| [ 'NEXT_PUBLIC_NETWORK_ICON', '' ], | ||
| ]); | ||
| }); | ||
|
|
||
| test('+@dark-mode', async({ render }) => { | ||
| const component = await render(<NetworkIcon/>); | ||
|
|
||
| await expect(component).toHaveScreenshot(); | ||
| }); | ||
| }); | ||
|
|
||
| test.describe('custom icon', () => { | ||
| let component: Locator; | ||
|
|
||
| test.beforeEach(async({ render, mockConfigResponse, mockEnvs }) => { | ||
| await mockEnvs([ | ||
| [ 'NEXT_PUBLIC_NETWORK_ICON', ICON_URL ], | ||
| ]); | ||
| await mockConfigResponse('NEXT_PUBLIC_NETWORK_ICON', ICON_URL, './playwright/mocks/image_svg.svg', true); | ||
| component = await render(<NetworkIcon/>); | ||
| }); | ||
|
|
||
| test('+@dark-mode', async() => { | ||
| await expect(component).toHaveScreenshot(); | ||
| }); | ||
| }); | ||
|
|
||
| test.describe('custom icon with dark option -@default +@dark-mode', () => { | ||
| let component: Locator; | ||
|
|
||
| test.beforeEach(async({ render, mockConfigResponse, mockEnvs }) => { | ||
| await mockEnvs([ | ||
| [ 'NEXT_PUBLIC_NETWORK_ICON', ICON_URL ], | ||
| [ 'NEXT_PUBLIC_NETWORK_ICON_DARK', ICON_URL ], | ||
| ]); | ||
| await mockConfigResponse('NEXT_PUBLIC_NETWORK_ICON', ICON_URL, './playwright/mocks/image_s.jpg', true); | ||
| await mockConfigResponse('NEXT_PUBLIC_NETWORK_ICON_DARK', ICON_URL, './playwright/mocks/image_s.jpg', true); | ||
|
|
||
| component = await render(<NetworkIcon/>); | ||
| }); | ||
|
|
||
| test('base view', async() => { | ||
| await expect(component).toHaveScreenshot(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import { chakra } from '@chakra-ui/react'; | ||
| import React from 'react'; | ||
|
|
||
| import { route } from 'nextjs-routes'; | ||
|
|
||
| import config from 'configs/app'; | ||
| import { useColorModeValue } from 'toolkit/chakra/color-mode'; | ||
| import { Image } from 'toolkit/chakra/image'; | ||
| import IconSvg from 'ui/shared/IconSvg'; | ||
|
|
||
| import { INVERT_FILTER } from './consts'; | ||
|
|
||
| const IconFallback = () => { | ||
| return ( | ||
| <IconSvg | ||
| name="networks/icon-placeholder" | ||
| w="30px" | ||
| h="30px" | ||
| color={{ base: 'blue.600', _dark: 'white' }} | ||
| aria-label="Network icon placeholder" | ||
| /> | ||
| ); | ||
| }; | ||
|
|
||
| type Props = { | ||
| className?: string; | ||
| }; | ||
|
|
||
| const NetworkIcon = ({ className }: Props) => { | ||
|
|
||
| const iconSrc = useColorModeValue(config.UI.navigation.icon.default, config.UI.navigation.icon.dark || config.UI.navigation.icon.default); | ||
|
|
||
| return ( | ||
| <chakra.a | ||
| className={ className } | ||
| href={ route({ pathname: '/' }) } | ||
| aria-label="Link to main page" | ||
| > | ||
| <Image | ||
| w="30px" | ||
| h="30px" | ||
| src={ iconSrc } | ||
| alt={ `${ config.chain.name } network icon` } | ||
| fallback={ <IconFallback/> } | ||
| filter={{ _dark: !config.UI.navigation.icon.dark ? INVERT_FILTER : undefined }} | ||
| objectFit="contain" | ||
| objectPosition="left" | ||
| /> | ||
| </chakra.a> | ||
| ); | ||
| }; | ||
|
|
||
| export default React.memo(chakra(NetworkIcon)); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.