-
-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(suite): Update passphrase modal #12076
Conversation
9a1a06f
to
bae5507
Compare
@@ -0,0 +1,26 @@ | |||
import styled from 'styled-components'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing except name is changed here
@@ -0,0 +1,199 @@ | |||
import { useCallback, useState } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing except name is changed here
9aa9872
to
dafcfd0
Compare
dafcfd0
to
4965f5a
Compare
e44385e
to
0a014fd
Compare
@@ -0,0 +1,433 @@ | |||
import { useState, useRef, useEffect, useCallback, ReactNode, ChangeEvent } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing except name is changed here
} | ||
|
||
// creating standard wallet here instead of showing dialog | ||
onSubmit(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates standard wallet
@@ -111,6 +111,8 @@ export const SuiteLayout = ({ children }: SuiteLayoutProps) => { | |||
|
|||
const isAccountPage = !!selectedAccount; | |||
|
|||
useAppShortcuts(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Us this right place for this? I think we have all the "global" staff in Main (I know we have 2, one for web and one for wallet) or Preloader. This should be just a layout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's not global, when you are in onboarding you shouldn't be able to run all shortcuts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 (Maybe lets add this info as a comment?)
packages/suite/src/components/suite/layouts/SuiteLayout/utils.ts
Outdated
Show resolved
Hide resolved
packages/suite/src/components/suite/modals/ModalSwitcher/ModalSwitcher.tsx
Outdated
Show resolved
Hide resolved
...e/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmation.tsx
Outdated
Show resolved
Hide resolved
...e/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmation.tsx
Outdated
Show resolved
Hide resolved
...e/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmation.tsx
Outdated
Show resolved
Hide resolved
...e/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmation.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/suite/SwitchDevice/DeviceItem/AddWalletButton.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/suite/SwitchDevice/DeviceItem/AddWalletButton.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceHeader.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectButton.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx
Outdated
Show resolved
Hide resolved
@@ -36,16 +36,19 @@ export const flexAlignItems = [ | |||
export type FlexDirection = (typeof flexDirection)[number]; | |||
export type FlexJustifyContent = (typeof flexJustifyContent)[number]; | |||
export type FlexAlignItems = (typeof flexAlignItems)[number]; | |||
export type Flex = string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is anyway beneficial, but why not. One day we may figure out how to make it stricter.
// import { | ||
// PassphraseTypeCardLegacy as PassphraseTypeCardComponent, | ||
// PassphraseTypeCardLegacyProps as PassphraseTypeCardProps, | ||
// } from './PassphraseTypeCardLegacy'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!
`; | ||
|
||
type PassphraseTypeCardContentProps = { | ||
submitLabel: React.ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think (from what I saw in the code) we prefer import from react and not use the whole React
reference.
content={ | ||
<FormattedMessage | ||
id="TR_HIDDEN_WALLET_TOOLTIP" | ||
defaultMessage="Passphrases add a custom phrase (e.g. a word, sentence, or string of characters) to your recovery seed. This creates a hidden wallet; each hidden wallet can use its own passphrase. Your standard wallet will still be accessible without a passphrase." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious: do we need those defaultMessage
in the code? We have them in message.jsom
file so here it seems to me as unnecessary stuff that pollutes code.
...e/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmation.tsx
Outdated
Show resolved
Hide resolved
.../components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep1.tsx
Outdated
Show resolved
Hide resolved
.../components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep1.tsx
Outdated
Show resolved
Hide resolved
.../components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep2.tsx
Outdated
Show resolved
Hide resolved
.../components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep3.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/suite/SwitchDevice/DeviceItem/AddWalletButton.tsx
Outdated
Show resolved
Hide resolved
@@ -123,6 +75,8 @@ export const DeviceItem = ({ device, instances, onCancel, backgroundRoute }: Dev | |||
handleRedirection(); | |||
}; | |||
|
|||
// @TODO add logic for creating standard/passphrase button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is forgotten or some unfinished work.
I am not really fan of TODOs in the code. I think you should:
a) finish it
b) or create issue for it and plan it
c) make peace with the fact this will never be done and just ignore it
Without the above, I have an experience that TODOs became just a wishes of the people long gone, polluting the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GOOD JOB!
Most of the comments are nits, but please fix at least the | undefined
return and delete the commented code in the storybook.
Then lets 🚢 🇮🇹
82bcf1d
to
e9ef67e
Compare
e9ef67e
to
c25d761
Compare
Description
Related Issue
Resolve
Screenshots:
Default switch device modal:
Switching view only:
Create passphrase wallet:
1. type passphrase
2. loading
3. unused wallet
4. open unused wallet
5. confirm passphrase