Skip to content

Commit f2c4c76

Browse files
authored
Design imprvs: chain list dropdown (#2828)
* Design imprvs: chain list dropdown * tests * design fixes * fix docs contents * remove test code * design fixes 2
1 parent 8374933 commit f2c4c76

File tree

55 files changed

+81
-156
lines changed

Some content is hidden

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

55 files changed

+81
-156
lines changed

configs/app/ui.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ const UI = Object.freeze({
5454
},
5555
highlightedRoutes,
5656
otherLinks: parseEnvJson<Array<NavItemExternal>>(getEnvValue('NEXT_PUBLIC_OTHER_LINKS')) || [],
57-
featuredNetworks: getExternalAssetFilePath('NEXT_PUBLIC_FEATURED_NETWORKS'),
5857
layout: (getEnvValue('NEXT_PUBLIC_NAVIGATION_LAYOUT') || 'vertical') as NavigationLayout,
5958
promoBanner: navigationPromoBanner,
6059
},
60+
featuredNetworks: {
61+
items: getExternalAssetFilePath('NEXT_PUBLIC_FEATURED_NETWORKS'),
62+
allLink: getEnvValue('NEXT_PUBLIC_FEATURED_NETWORKS_ALL_LINK'),
63+
},
6164
footer: {
6265
links: getExternalAssetFilePath('NEXT_PUBLIC_FOOTER_LINKS'),
6366
frontendVersion: getEnvValue('NEXT_PUBLIC_GIT_TAG'),

configs/envs/.env.base

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ NEXT_PUBLIC_DEFI_DROPDOWN_ITEMS=[{'text':'Swapscout','icon':'swap','dappId':'swa
2020
NEXT_PUBLIC_DEX_POOLS_ENABLED=true
2121
NEXT_PUBLIC_FAULT_PROOF_ENABLED=true
2222
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/featured-networks/eth.json
23+
NEXT_PUBLIC_FEATURED_NETWORKS_ALL_LINK=https://chains.blockscout.com/
2324
NEXT_PUBLIC_FOOTER_LINKS=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/footer-links/base-mainnet.json
2425
NEXT_PUBLIC_GAME_BADGE_CLAIM_LINK=https://badges.blockscout.com/mint/sherblockHolmesBadge
2526
NEXT_PUBLIC_GAS_REFUEL_PROVIDER_CONFIG={'name': 'Need gas?', 'url_template': 'https://smolrefuel.com/?outboundChain={chainId}&partner=blockscout&utm_source=blockscout&disableBridges=true', 'dapp_id': 'smol-refuel', 'logo': 'https://blockscout-content.s3.amazonaws.com/smolrefuel-logo-action-button.png'}

configs/envs/.env.eth

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL=ws
1212
NEXT_PUBLIC_USER_OPS_INDEXER_API_HOST=https://user-ops-indexer-base-mainnet.k8s-prod-2.blockscout.com
1313

1414
# Instance ENVs
15+
NEXT_PUBLIC_NAVIGATION_LAYOUT=horizontal
1516
NEXT_PUBLIC_ADMIN_SERVICE_API_HOST=https://admin-rs.services.blockscout.com
1617
NEXT_PUBLIC_API_BASE_PATH=/
1718
NEXT_PUBLIC_API_HOST=eth.blockscout.com
@@ -22,6 +23,7 @@ NEXT_PUBLIC_DATA_AVAILABILITY_ENABLED=true
2223
NEXT_PUBLIC_DEFI_DROPDOWN_ITEMS=[{'text':'Swapscout','icon':'swap','dappId':'swapscout'},{'text':'Revokescout','icon':'integration/partial','dappId':'revokescout'},{'text':'Payment link','icon':'payment_link','dappId':'peanut-protocol'}]
2324
NEXT_PUBLIC_DEX_POOLS_ENABLED=true
2425
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/featured-networks/eth.json
26+
NEXT_PUBLIC_FEATURED_NETWORKS_ALL_LINK=https://chains.blockscout.com/
2527
NEXT_PUBLIC_FOOTER_LINKS=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/footer-links/eth-mainnet.json
2628
NEXT_PUBLIC_GAME_BADGE_CLAIM_LINK=https://badges.blockscout.com/mint/sherblockHolmesBadge
2729
NEXT_PUBLIC_PUZZLE_GAME_BADGE_CLAIM_LINK=https://badges.blockscout.com/mint/sherblockHolmesBadge

deploy/tools/envs-validator/schema.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,13 @@ const schema = yup
811811
.array()
812812
.json()
813813
.of(featuredNetworkSchema),
814+
NEXT_PUBLIC_FEATURED_NETWORKS_ALL_LINK: yup
815+
.string()
816+
.when('NEXT_PUBLIC_FEATURED_NETWORKS', {
817+
is: (value: Array<unknown> | undefined) => value && value.length > 0,
818+
then: (schema) => schema.test(urlTest),
819+
otherwise: (schema) => schema.max(-1, 'NEXT_PUBLIC_FEATURED_NETWORKS_ALL_LINK can only be set when NEXT_PUBLIC_FEATURED_NETWORKS is configured'),
820+
}),
814821
NEXT_PUBLIC_OTHER_LINKS: yup
815822
.array()
816823
.transform(replaceQuotes)

deploy/tools/envs-validator/test/.env.base

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ NEXT_PUBLIC_CONTRACT_CODE_IDES=[{'title':'Remix IDE','url':'https://remix.blocks
2525
NEXT_PUBLIC_CONTRACT_INFO_API_HOST=https://example.com
2626
NEXT_PUBLIC_DATA_AVAILABILITY_ENABLED=true
2727
NEXT_PUBLIC_FEATURED_NETWORKS=https://example.com
28+
NEXT_PUBLIC_FEATURED_NETWORKS_ALL_LINK=https://example.com
2829
NEXT_PUBLIC_NAVIGATION_HIGHLIGHTED_ROUTES=['/accounts','/apps']
2930
NEXT_PUBLIC_NAVIGATION_LAYOUT=horizontal
3031
NEXT_PUBLIC_FONT_FAMILY_HEADING={'name':'Montserrat','url':'https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap'}

deploy/values/review/values.yaml.gotmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ frontend:
4949
env:
5050
NEXT_PUBLIC_APP_ENV: review
5151
NEXT_PUBLIC_FEATURED_NETWORKS: https://raw.githubusercontent.com/blockscout/frontend-configs/dev/configs/featured-networks/eth-sepolia.json
52+
NEXT_PUBLIC_FEATURED_NETWORKS_ALL_LINK: https://chains.blockscout.com/
5253
NEXT_PUBLIC_NETWORK_LOGO: https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-logos/sepolia.svg
5354
NEXT_PUBLIC_NETWORK_ICON: https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-icons/sepolia.png
5455
NEXT_PUBLIC_API_HOST: eth-sepolia.k8s-dev.blockscout.com

docs/ENVS.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ All json-like values should be single-quoted. If it contains a hash (`#`) or a d
2222
- [UI configuration](#ui-configuration)
2323
- [Homepage](#homepage)
2424
- [Navigation](#navigation)
25+
- [Featured networks](#featured-networks)
2526
- [Footer](#footer)
2627
- [Favicon](#favicon)
2728
- [Meta](#meta)
@@ -161,12 +162,18 @@ _Note_ Here, all values are arrays of up to two strings. The first string repres
161162
| NEXT_PUBLIC_NETWORK_LOGO_DARK | `string` | Network logo for dark color mode; if not provided, **inverted** regular logo will be used instead | - | - | `https://placekitten.com/240/40` | v1.0.x+ |
162163
| NEXT_PUBLIC_NETWORK_ICON | `string` | Network icon; used as a replacement for regular network logo when nav bar is collapsed; if not provided, placeholder will be shown; *Note* the icon size should be at least 60px by 60px | - | - | `https://placekitten.com/60/60` | v1.0.x+ |
163164
| NEXT_PUBLIC_NETWORK_ICON_DARK | `string` | Network icon for dark color mode; if not provided, **inverted** regular icon will be used instead | - | - | `https://placekitten.com/60/60` | v1.0.x+ |
164-
| NEXT_PUBLIC_FEATURED_NETWORKS | `string` | URL of configuration file (`.json` format only) or file content string representation. It contains list of featured networks that will be shown in the network menu. See [below](#featured-network-configuration-properties) list of available properties for particular network | - | - | `https://example.com/featured_networks_config.json` \| `[{'title':'Astar(EVM)','url':'https://astar.blockscout.com/','group':'Mainnets','icon':'https://example.com/astar.svg'}]` | v1.0.x+ |
165165
| NEXT_PUBLIC_OTHER_LINKS | `Array<{url: string; text: string}>` | List of links for the "Other" navigation menu | - | - | `[{'url':'https://blockscout.com','text':'Blockscout'}]` | v1.0.x+ |
166166
| NEXT_PUBLIC_NAVIGATION_HIGHLIGHTED_ROUTES | `Array<string>` | List of menu item routes that should have a lightning label | - | - | `['/accounts']` | v1.31.0+ |
167167
| NEXT_PUBLIC_NAVIGATION_LAYOUT | `vertical \| horizontal` | Navigation menu layout type | - | `vertical` | `horizontal` | v1.32.0+ |
168168
| NEXT_PUBLIC_NAVIGATION_PROMO_BANNER_CONFIG | `string` | Configuration of promo banner in the navigation menu. See [below](#navigation-promo-banner-configuration-properties) list of available properties for particular banner type | - | - | `{'img_url': 'https://example.com/promo.svg', 'text': 'Promo text', 'bg_color': {'light': 'rgb(250, 245, 255)', 'dark': 'rgb(68, 51, 122)'}, 'text_color': {'light': 'rgb(107, 70, 193)', 'dark': 'rgb(233, 216, 253)'}, 'link_url': 'https://example.com'}` | v2.3.0+ |
169169

170+
### Featured networks
171+
172+
| Variable | Type| Description | Compulsoriness | Default value | Example value | Version |
173+
| --- | --- | --- | --- | --- | --- | --- |
174+
| NEXT_PUBLIC_FEATURED_NETWORKS | `string` | URL of configuration file (`.json` format only) or file content string representation. It contains list of featured networks that will be shown in the network menu. See [below](#featured-network-configuration-properties) list of available properties for particular network | - | - | `https://example.com/featured_networks_config.json` \| `[{'title':'Astar(EVM)','url':'https://astar.blockscout.com/','group':'Mainnets','icon':'https://example.com/astar.svg'}]` | v1.0.x+ |
175+
| NEXT_PUBLIC_FEATURED_NETWORKS_ALL_LINK | `string` | Link to the all chains resource. Will be displayed at the bottom of featured networks list. | Works only if NEXT_PUBLIC_FEATURED_NETWORKS is set | - | `https://example.com` | v2.3.0+ |
176+
170177
#### Featured network configuration properties
171178

172179
| Variable | Type| Description | Compulsoriness | Default value | Example value |

toolkit/theme/foundations/semanticTokens.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,10 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
208208
},
209209
segmented: {
210210
fg: {
211-
DEFAULT: { value: { _light: '{colors.blue.600}', _dark: '{colors.blue.300}' } },
212-
selected: { value: { _light: '{colors.blue.700}', _dark: '{colors.gray.50}' } },
211+
DEFAULT: { value: { _light: '{colors.blackAlpha.800}', _dark: '{colors.whiteAlpha.800}' } },
213212
},
214213
border: {
215-
DEFAULT: { value: { _light: '{colors.blue.50}', _dark: '{colors.gray.800}' } },
214+
DEFAULT: { value: { _light: '{colors.blue.50}', _dark: '{colors.whiteAlpha.100}' } },
216215
},
217216
},
218217
},

toolkit/theme/recipes/tabs.recipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export const recipe = defineSlotRecipe({
190190
_selected: {
191191
color: 'tabs.segmented.fg.selected',
192192
bg: 'tabs.segmented.border',
193-
borderColor: 'tabs.segmented.border',
193+
borderColor: 'transparent',
194194
_hover: {
195195
color: 'tabs.segmented.fg.selected',
196196
},
-956 Bytes
Loading

0 commit comments

Comments
 (0)