-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from lidofinance/develop
from develop to main
- Loading branch information
Showing
14 changed files
with
75 additions
and
283 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path fill-rule="evenodd" d="m12.064 3.702 6.058 10.512c.133.314.191.57.208.834a2.3 2.3 0 0 1-.608 1.685c-.425.462-1 .734-1.625.767H3.899a2.624 2.624 0 0 1-.758-.165c-1.208-.487-1.792-1.858-1.3-3.046L7.94 3.694c.208-.372.525-.693.917-.9a2.375 2.375 0 0 1 3.207.908Zm-1.341 6.928a.73.73 0 0 1-.725.727.737.737 0 0 1-.733-.727V8.294c0-.397.333-.719.733-.719.4 0 .725.322.725.719v2.336Zm-.725 3.551a.737.737 0 0 1-.733-.726c0-.398.333-.728.733-.728.4 0 .725.323.725.719a.732.732 0 0 1-.725.735Z" clip-rule="evenodd"/></svg> |
This file contains 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
28 changes: 11 additions & 17 deletions
28
modules/blockChain/ui/NetworkSwitcher/NetworkSwitcher.tsx
This file contains 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 |
---|---|---|
@@ -1,24 +1,18 @@ | ||
import { useConfig } from 'modules/config/hooks/useConfig' | ||
import { useErrorMessage } from 'modules/blockChain/hooks/useErrorMessage' | ||
|
||
import { Text } from 'modules/shared/ui/Common/Text' | ||
import { Title } from 'modules/shared/ui/Common/Title' | ||
|
||
import { getChainName } from 'modules/blockChain/chains' | ||
import { Container } from '@lidofinance/lido-ui' | ||
import { Wrap } from './NetworkSwitcherStyle' | ||
import DangerIconSVG from 'assets/icons/danger.com.svg.react' | ||
|
||
export function NetworkSwitcher() { | ||
const { supportedChainIds } = useConfig() | ||
const errorMessage = useErrorMessage() | ||
|
||
return ( | ||
<> | ||
<Title | ||
title="Network does not match" | ||
subtitle={<>Please, switch to one of supported network:</>} | ||
/> | ||
<Text size={16} weight={500} isCentered> | ||
{supportedChainIds.map(supportedChainId => ( | ||
<div key={supportedChainId}>{getChainName(supportedChainId)}</div> | ||
))} | ||
</Text> | ||
</> | ||
<Container size="full"> | ||
<Wrap> | ||
<DangerIconSVG /> | ||
<span>{errorMessage}</span> | ||
</Wrap> | ||
</Container> | ||
) | ||
} |
25 changes: 22 additions & 3 deletions
25
modules/blockChain/ui/NetworkSwitcher/NetworkSwitcherStyle.ts
This file contains 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 |
---|---|---|
@@ -1,7 +1,26 @@ | ||
import styled from 'styled-components' | ||
|
||
export const NetworksBox = styled.div` | ||
export const Wrap = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
gap: 10px; | ||
align-items: center; | ||
margin-bottom: ${({ theme }) => theme.spaceMap.xxl}px; | ||
padding: ${({ theme }) => theme.spaceMap.lg}px; | ||
color: var(--lido-color-textDark); | ||
font-size: ${({ theme }) => theme.fontSizesMap.xxs}px; | ||
font-weight: 400; | ||
border-radius: ${({ theme }) => theme.borderRadiusesMap.md}px; | ||
background: radial-gradient( | ||
76.72% 76.72% at 50% 67.59%, | ||
rgba(255, 201, 208, 0.6) 0%, | ||
rgba(255, 237, 237, 0.6) 68.99%, | ||
rgba(255, 255, 255, 0.6) 100% | ||
); | ||
box-shadow: inset 0px -20px 93px rgba(255, 214, 0, 0.44); | ||
& svg { | ||
display: block; | ||
flex: 0 0 auto; | ||
margin-right: ${({ theme }) => theme.spaceMap.sm}px; | ||
fill: var(--lido-color-textDark); | ||
} | ||
` |
This file contains 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 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 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 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
Oops, something went wrong.