-
Notifications
You must be signed in to change notification settings - Fork 121
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
Trezor modals improvements #2956
Conversation
cac5438
to
42514d4
Compare
Thanks @matheusd for the review. PIN_LABELS has been removed and the input disabled. |
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.
Looks good to me. All of the modals working.
1b8fb24
to
f54ea0b
Compare
Needs a rebase then should be able to merge |
f54ea0b
to
9e3f2e0
Compare
Rebased. |
Apologies, another rebase now. |
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.
Nice work - left couple of suggestions.
|
||
let Component = null; | ||
|
||
if (waitingForPin) { |
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.
you could use useMemo
to memorize the Component
value.
|
||
const trezorLabel = device ? deviceLabel : ""; | ||
|
||
const className = classNames( |
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.
Redundant const
9e3f2e0
to
3e38f0c
Compare
Rebased. |
Create useTrezor custom hook
e51a9e6
to
182090b
Compare
This PR standardizes several implementation details among Trezor related components:
Refactor Trezor modals, finishing Modal components refactoring #2515 according to [discussion] Functional components & hooks #2438 and [discussion] CSS modules #2439.
Improve Trezor modals, removes misalignments and
CSS
bugs, centralize PIN panel and change cancel and blue button position to right insted of left, similar to all other modals.Standardize all modals position according to:
margin-right: 296px;
margin-bottom: 100px;
margin-bottom: 100px;
This approach centralizes all modals horizontally and vertically (nearly, since most SO's have top bars in their windows), in addition to avoid unconformities between modals ans specific
CSS
rules.This change also removes the necessity of setting
position: fixed;
,top: 0;
,bottom: 0;
,left: 0;
,right: 0;
andmargin: auto;
in modals, taking advantage of the already set combination ofdisplay: flex;
,align-items: center;
andjustify-content: center;
rules in overlay classes instead, much more reliable and modern.Prepare for the implementation of a new modal to solve Trezor firmware update progress bar #2955.
Rename Trezor constants to CONSTANT_CASE.
Closes Misalignment in Trezor modals #2897, closes Trezor: Letters in Pin entry are odd #2562 and closes [1.4.0-rc] Mismatched PIN input for trezor/decrediton. #1932.
All changes have been tested with Trezor model One emulator and latest master.