-
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.
feat: support multiple accounts in Wallet UI (#506)
* refactor: add account discover service * feat: support multiple account in SNAP * feat: watch the SNAP current account * fix: lint * feat: support multiple account --------- Co-authored-by: khanti42 <[email protected]>
- Loading branch information
1 parent
c129f1c
commit a9fcd27
Showing
32 changed files
with
1,138 additions
and
586 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
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
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
33 changes: 33 additions & 0 deletions
33
...es/wallet-ui/src/components/ui/organism/AccountSwitchModal/AccountSwitchModal.stories.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 { Meta } from '@storybook/react'; | ||
import { AccountSwitchModalView } from './AccountSwitchModal.view'; | ||
|
||
export default { | ||
title: 'Molecule/AccountAddress', | ||
component: AccountSwitchModalView, | ||
} as Meta; | ||
|
||
const wrapperStyle = { | ||
backgroundColor: 'white', | ||
height: '300px', | ||
alignItems: 'center', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
}; | ||
|
||
export const Default = () => ( | ||
<div style={wrapperStyle}> | ||
<AccountSwitchModalView></AccountSwitchModalView> | ||
</div> | ||
); | ||
|
||
export const Full = () => ( | ||
<div style={wrapperStyle}> | ||
<AccountSwitchModalView full></AccountSwitchModalView> | ||
</div> | ||
); | ||
|
||
export const DarkerBackground = () => ( | ||
<div style={{ ...wrapperStyle, backgroundColor: 'grey' }}> | ||
<AccountSwitchModalView full></AccountSwitchModalView> | ||
</div> | ||
); |
61 changes: 61 additions & 0 deletions
61
packages/wallet-ui/src/components/ui/organism/AccountSwitchModal/AccountSwitchModal.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,61 @@ | ||
import { AccountImage } from 'components/ui/atom/AccountImage'; | ||
import { Button } from 'components/ui/atom/Button'; | ||
import styled from 'styled-components'; | ||
|
||
export const MenuSection = styled.div` | ||
padding: 0px 10px; | ||
display: flex; | ||
flex-direction: column; | ||
height: 202; | ||
overflow-y: auto; | ||
`; | ||
|
||
export const Wrapper = styled(Button).attrs((props) => ({ | ||
fontSize: props.theme.typography.c1.fontSize, | ||
upperCaseOnly: false, | ||
textStyle: { | ||
fontWeight: props.theme.typography.p1.fontWeight, | ||
fontFamily: props.theme.typography.p1.fontFamily, | ||
}, | ||
iconStyle: { | ||
fontSize: props.theme.typography.i1.fontSize, | ||
color: props.theme.palette.grey.grey1, | ||
}, | ||
}))` | ||
padding: 4px 5px; | ||
height: 25px; | ||
color: ${(props) => props.theme.palette.grey.black}; | ||
border-radius: 24px; | ||
border: 1px solid ${(props) => props.theme.palette.grey.grey3}; | ||
:hover { | ||
background-color: ${(props) => props.theme.palette.grey.grey4}; | ||
border: none; | ||
} | ||
`; | ||
|
||
export const Normal = styled.div` | ||
font-size: ${(props) => props.theme.typography.p1.fontSize}; | ||
`; | ||
|
||
export const AccountSwitchMenuItem = styled.div` | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
padding: 14px; | ||
justify-content: space-between; | ||
`; | ||
|
||
export const AccountImageStyled = styled(AccountImage)` | ||
margin-left: ${(props) => props.theme.spacing.small}; | ||
cursor: pointer; | ||
`; | ||
|
||
export const Container = styled.div` | ||
display: flex; | ||
alignitems: center; | ||
`; | ||
|
||
export const MenuItemText = styled.span` | ||
${(props) => props.theme.typography.p2}; | ||
`; |
Oops, something went wrong.