-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(trezor): control for selecting account (#3048)
* chore: trezor setup * feat(trezor): sign and send transaction * feat(trezor): display approve tx error in modal * fix(trezor): use gas price for tx * feat(trezor): sign typed data * fix(trezor): display icon in pending tx modal * chore: fix trezor icon * fix(trezor): allow switching network * feat(trezor): selector for account index * refactor(trezor): extract sendTransactionHandler * refactor(trezor): extract TrezorConnector * chore: fix double activation * fix: fix metamask approving banner conditions * chore: fix gasPrice * feat(wallets): display connection error in modal * fix: dispose trezor on connection fail * fix: deactivate connector on trezor disconnect * chore: merge develop * chore: fix * chore: temp fix * chore: temp fix * refactor: address code review issues * chore: revert fix * fix: clean state on deactivate * chore: refactor * feat(trezor): load first 100 accounts * feat(trezor): select account index in one click * feat(trezor): hide the wallet under feature-flag * chore: hide Trezor by feature-flag * feat(trezor): display accounts balances * feat: add trezor account select functionality * chore: fix files location * refactor: integrate hardware wallet account selector * refactor: refactor AccountSelectorModal * fix: short addresses in list * fix: indicate account changes * feat(wallets): display snackbar on hardware wallet account changes * chore: deprecate old module * chore: docs * feat: display wallet name and icon * chore: fix tests for new jest * feat: add trezor account select functionality * feat: add trezor account select functionality --------- Co-authored-by: shoom3301 <[email protected]>
- Loading branch information
1 parent
62eb3e0
commit e391f96
Showing
58 changed files
with
1,439 additions
and
293 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
21 changes: 21 additions & 0 deletions
21
apps/cowswap-frontend/src/common/pure/ButtonSecondary/index.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,21 @@ | ||
import styled from 'styled-components/macro' | ||
|
||
export const ButtonSecondary = styled.button` | ||
background: var(--cow-color-lightBlue-opacity-90); | ||
color: var(--cow-color-lightBlue); | ||
font-size: 12px; | ||
font-weight: 600; | ||
border: 0; | ||
box-shadow: none; | ||
border-radius: 12px; | ||
position: relative; | ||
transition: background 0.2s ease-in-out; | ||
min-height: 35px; | ||
padding: 0 12px; | ||
cursor: pointer; | ||
white-space: nowrap; | ||
&:hover { | ||
background: var(--cow-color-lightBlue-opacity-80); | ||
} | ||
` |
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
29 changes: 29 additions & 0 deletions
29
apps/cowswap-frontend/src/common/pure/SelectDropdown/index.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,29 @@ | ||
import styled from 'styled-components/macro' | ||
|
||
export const SelectDropdown = styled.select` | ||
border-radius: 12px; | ||
padding: 8px 34px 8px 8px; | ||
border-radius: 12px; | ||
appearance: none; | ||
cursor: pointer; | ||
transition: background 0.2s ease-in-out; | ||
width: 100%; | ||
outline: none; | ||
border: 1px solid var(--cow-color-border); | ||
color: var(--cow-color-text1); | ||
background: linear-gradient(45deg, transparent 50%, var(--cow-color-lightBlue) 50%) calc(100% - 13px) calc(13px) / 5px | ||
5px no-repeat, | ||
linear-gradient(135deg, var(--cow-color-lightBlue) 50%, transparent 50%) calc(100% - 8px) calc(13px) / 5px 5px | ||
no-repeat, | ||
linear-gradient(to right, var(--cow-color-lightBlue-opacity-90), var(--cow-color-lightBlue-opacity-90)) 100% 0 / | ||
26px 100% no-repeat; | ||
&:hover { | ||
background: linear-gradient(45deg, transparent 50%, var(--cow-color-lightBlue) 50%) calc(100% - 13px) calc(13px) / | ||
5px 5px no-repeat, | ||
linear-gradient(135deg, var(--cow-color-lightBlue) 50%, transparent 50%) calc(100% - 8px) calc(13px) / 5px 5px | ||
no-repeat, | ||
linear-gradient(to right, var(--cow-color-lightBlue-opacity-80), var(--cow-color-lightBlue-opacity-80)) 100% 0 / | ||
26px 100% no-repeat; | ||
} | ||
` |
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
39 changes: 39 additions & 0 deletions
39
apps/cowswap-frontend/src/modules/account/containers/AccountDetails/index.cosmos.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,39 @@ | ||
import { useSelect } from 'react-cosmos/client' | ||
import styled from 'styled-components/macro' | ||
|
||
import { AccountDetails } from './index' | ||
|
||
const defaultProps = { | ||
pendingTransactions: [], | ||
confirmedTransactions: [], | ||
toggleWalletModal: () => void 0, | ||
toggleAccountSelectorModal: () => void 0, | ||
handleCloseOrdersPanel: () => void 0, | ||
} | ||
|
||
const Wrapper = styled.div` | ||
width: 800px; | ||
margin: 100px auto; | ||
padding: 20px; | ||
` | ||
|
||
// const chainId = 5 | ||
|
||
function Host() { | ||
const [isHardWare] = useSelect('Is hardware wallet', { | ||
options: ['true', 'false'], | ||
defaultValue: 'false', | ||
}) | ||
|
||
return ( | ||
<Wrapper> | ||
<AccountDetails {...defaultProps} forceHardwareWallet={isHardWare === 'true'} /> | ||
</Wrapper> | ||
) | ||
} | ||
|
||
const Fixtures = { | ||
default: <Host />, | ||
} | ||
|
||
export default Fixtures |
Oops, something went wrong.