-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'chore/fix-ui-redux-state-over-listen' into feat/account…
…-drawer-ui
- Loading branch information
Showing
10 changed files
with
127 additions
and
53 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
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
46 changes: 46 additions & 0 deletions
46
...et-ui/src/components/ui/organism/MinMetamaskVersionModal/MinMetamaskVersionModal.style.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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import styled from 'styled-components'; | ||
import starknetSrc from 'assets/images/starknet-logo.svg'; | ||
import metamaskSrc from 'assets/images/metamask-fox-icon.svg'; | ||
|
||
export const Wrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
background-color: ${(props) => props.theme.palette.grey.white}; | ||
width: ${(props) => props.theme.modal.base}; | ||
padding: ${(props) => props.theme.spacing.base}; | ||
padding-top: 40px; | ||
border-radius: 8px; | ||
align-items: center; | ||
a { | ||
all: unset; | ||
} | ||
`; | ||
|
||
export const StarknetLogo = styled.img.attrs(() => ({ | ||
src: starknetSrc, | ||
}))` | ||
width: 158px; | ||
height: 32px; | ||
margin-bottom: 32px; | ||
`; | ||
|
||
export const MetaMaskLogo = styled.img.attrs(() => ({ | ||
src: metamaskSrc, | ||
}))` | ||
width: 32px; | ||
height: 32px; | ||
`; | ||
|
||
export const Title = styled.div` | ||
text-align: center; | ||
font-size: ${(props) => props.theme.typography.h3.fontSize}; | ||
font-weight: ${(props) => props.theme.typography.h3.fontWeight}; | ||
font-family: ${(props) => props.theme.typography.h3.fontFamily}; | ||
line-height: ${(props) => props.theme.typography.h3.lineHeight}; | ||
margin-bottom: 8px; | ||
`; | ||
|
||
export const Description = styled.div` | ||
font-size: ${(props) => props.theme.typography.p2.fontSize}; | ||
color: ${(props) => props.theme.palette.grey.grey1}; | ||
`; |
33 changes: 33 additions & 0 deletions
33
...et-ui/src/components/ui/organism/MinMetamaskVersionModal/MinMetamaskVersionModal.view.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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { MIN_METAMASK_VERSION } from 'utils/constants'; | ||
import { | ||
Description, | ||
MetaMaskLogo, | ||
StarknetLogo, | ||
Title, | ||
Wrapper, | ||
} from './MinMetamaskVersionModal.style'; | ||
import { ConnectButton } from '../ConnectModal/ConnectModal.style'; | ||
import { useMultiLanguage } from 'services'; | ||
|
||
export const MinMetamaskVersionModalView = () => { | ||
const { translate } = useMultiLanguage(); | ||
|
||
return ( | ||
<Wrapper> | ||
<StarknetLogo /> | ||
<> | ||
<Title>{translate('metaMaskUpgradeNeeded')}</Title> | ||
<br /> | ||
<Description> | ||
{translate('updateMetaMaskVersion', MIN_METAMASK_VERSION)} | ||
</Description> | ||
<br /> | ||
<a href="https://metamask.io" target="_blank" rel="noreferrer"> | ||
<ConnectButton customIconLeft={<MetaMaskLogo />} onClick={() => {}}> | ||
{translate('goToMetaMaskWebsite')} | ||
</ConnectButton> | ||
</a> | ||
</> | ||
</Wrapper> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/wallet-ui/src/components/ui/organism/MinMetamaskVersionModal/index.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export { MinMetamaskVersionModalView as MinMetamaskVersionModal } from './MinMetamaskVersionModal.view'; |
45 changes: 12 additions & 33 deletions
45
packages/wallet-ui/src/components/ui/organism/MinVersionModal/MinVersionModal.view.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,50 +1,29 @@ | ||
import { MIN_METAMASK_VERSION } from 'utils/constants'; | ||
import { | ||
Description, | ||
MetaMaskLogo, | ||
StarknetLogo, | ||
Title, | ||
Wrapper, | ||
} from './MinVersionModal.style'; | ||
import { useHasMetamask } from 'hooks/useHasMetamask'; | ||
import { ConnectButton } from '../ConnectModal/ConnectModal.style'; | ||
import { useMultiLanguage } from 'services'; | ||
|
||
export const MinVersionModalView = () => { | ||
const { metaMaskUpgradeRequired } = useHasMetamask(); | ||
const { translate } = useMultiLanguage(); | ||
|
||
return ( | ||
<Wrapper> | ||
<StarknetLogo /> | ||
{metaMaskUpgradeRequired ? ( | ||
<> | ||
<Title>{translate('metaMaskUpgradeNeeded')}</Title> | ||
<br /> | ||
<Description> | ||
{translate('updateMetaMaskVersion', MIN_METAMASK_VERSION)} | ||
</Description> | ||
<br /> | ||
<a href="https://metamask.io" target="_blank" rel="noreferrer"> | ||
<ConnectButton customIconLeft={<MetaMaskLogo />} onClick={() => {}}> | ||
{translate('goToMetaMaskWebsite')} | ||
</ConnectButton> | ||
</a> | ||
</> | ||
) : ( | ||
<> | ||
<Title>{translate('newVersionAvailable')}</Title> | ||
<Description> | ||
{translate('installLatestVersion')} | ||
<ul> | ||
<li>{translate('deleteCurrentVersionMetaMask')}</li> | ||
<li>{translate('refreshPage')}</li> | ||
<li>{translate('connectToMetaMask')}</li> | ||
</ul> | ||
{translate('accountRecoveryInfo')} | ||
</Description> | ||
</> | ||
)} | ||
<> | ||
<Title>{translate('newVersionAvailable')}</Title> | ||
<Description> | ||
{translate('installLatestVersion')} | ||
<ul> | ||
<li>{translate('deleteCurrentVersionMetaMask')}</li> | ||
<li>{translate('refreshPage')}</li> | ||
<li>{translate('connectToMetaMask')}</li> | ||
</ul> | ||
{translate('accountRecoveryInfo')} | ||
</Description> | ||
</> | ||
</Wrapper> | ||
); | ||
}; |
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