1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/pages/settings/index.scss
Dan J Miller 9d70c60c22
Connect Ledger via WebHID (#12411)
* Connect ledger via webhid if that option is available

* Explicitly setting preference for webhid

* Use ledgerTransportType enum instead of booleans for ledger live and webhid preferences

* Use single setLEdgerTransport preference methods and property

* Temp

* Lint fix

* Unit test fix

* Remove async keyword from setLedgerTransportPreference function definition in preferences controller

* Fix ledgelive setting toggle logic

* Migrate useLedgerLive preference property to ledgerTransportType

* Use shared constants for ledger transport type enums

* Use constant for ledger usb vendor id

* Use correct property to check if ledgerLive preference is set when deciding whether to ask for webhid connection

* Update eth-ledger-bridge-keyring to v0.9.0

* Only show ledger live transaction helper messages if using ledger live

* Only show ledger live part of tutorial if ledger live setting is on

* Fix ledger related prop type errors

* Explicitly use u2f enum instead of empty string as a transport type; default transport type to webhid if available; use constants for u2f and webhid

* Cleanup

* Wrap ledger webhid device request in try/catch

* Clean up

* Lint fix

* Ensure user can easily connect their ledger wallet when they need to.

* Fix locales

* Fix/improve locales changes

* Remove unused isFirefox property from confirm-transaction-base.container.js

* Disable transaction and message signing confirmation if ledger webhid requires connection

* Ensure translation keys for ledger connection options in settings dropdown can be properly detected by verify-locales

* Drop .component from ledger-instruction-field file name

* Move renderLedgerLiveStep to module scope

* Remove ledgerLive from function and message names in ledger-instruction-field

* Wrap ledger connection logic in ledger-instruction-field in try catch

* Clean up signature-request.component.js

* Check whether the signing address, and not the selected address, is a ledger account in singature-request.container

* Ensure ledger instructions and webhid connection button are shown on signature-request-original signatures

* Improve webhid selection handling in select-ledger-transport-type onChange handler

* Move metamask redux focused ledger selectors to metamask duck

* Lint fix

* Use async await in checkWebHidStatusRef.current

* Remove unnecessary use of ref in ledger-instruction-field.js

* Lint fix

* Remove unnecessary try/catch in ledger-instruction-field.js

* Check if from address, not selected address, is from a ledger account in confirm-approve

* Move findKeyringForAddress to metamask duck

* Fix typo in function name

* Ensure isEqualCaseInsensitive handles possible differences in address casing

* Fix Learn More link size in advanced settings tab

* Update app/scripts/migrations/066.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Update ui/pages/settings/advanced-tab/advanced-tab.component.test.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Add jsdoc comments for new selectors

* Use jest.spyOn for mocking navigator in ledger webhid migration tests

* Use LEDGER_TRANSPORT_TYPES values to set proptype of ledgerTransportType

* Use LEDGER_TRANSPORT_TYPES values to set proptype of ledgerTransportType

* Fix font size of link in ledger connection description in advanced settings

* Fix return type in setLedgerTransportPreference comment

* Clean up connectHardware code for webhid connection in actions.js

* Update app/scripts/migrations/066.test.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Update ui/ducks/metamask/metamask.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Add migration test for when useLedgerLive is true in a browser that supports webhid

* Lint fix

* Fix inline-link size

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-10-21 16:47:03 -02:30

270 lines
4.5 KiB
SCSS

@import 'info-tab/index';
@import 'alerts-tab/alerts-tab';
@import 'networks-tab/index';
@import 'settings-tab/index';
@import 'contact-list-tab/index';
.settings-page {
position: relative;
background: $white;
display: flex;
flex-flow: column nowrap;
&__header {
display: flex;
flex-flow: row nowrap;
padding: 12px 24px;
align-items: center;
flex: 0 0 auto;
&__title {
@include H3;
flex: 1 0 auto;
@media screen and (max-width: $break-small) {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-width: 250px;
}
}
}
&__subheader,
&__subheader--link {
@include H4;
padding: 16px 4px;
border-bottom: 1px solid $alto;
margin-right: 24px;
height: 72px;
align-items: center;
display: flex;
flex-flow: row nowrap;
@media screen and (max-width: $break-small) {
display: none;
}
}
&__subheader--link {
cursor: pointer;
margin-right: 4px;
}
&__subheader--link:hover {
cursor: pointer;
color: $primary-blue;
}
&__subheader--break {
margin-inline-start: 4px;
}
&__sub-header {
height: 72px;
border-bottom: 1px solid #d8d8d8;
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 0;
@media screen and (max-width: $break-small) {
height: 69px;
position: relative;
text-align: center;
}
}
&__sub-header-text {
@include H4;
@media screen and (max-width: $break-small) {
@include H5;
width: 100%;
}
}
&__back-button {
display: none;
@media screen and (max-width: $break-small) {
display: block;
background-image: url('/images/caret-left-black.svg');
width: 18px;
height: 18px;
opacity: 0.5;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
margin-right: 16px;
cursor: pointer;
[dir='rtl'] & {
transform: rotate(180deg);
}
}
}
&__close-button {
margin-left: auto;
}
&__close-button::after {
content: '\00D7';
font-size: 40px;
color: $dusty-gray;
cursor: pointer;
}
&__content {
display: flex;
flex-flow: row nowrap;
height: 100%;
overflow: auto;
border-top: 1px solid #d8d8d8;
&__tabs {
display: flex;
flex-direction: column;
flex: 1 1 auto;
@media screen and (min-width: $break-large) {
flex: 0 0 40%;
max-width: 210px;
padding-top: 8px;
}
.tab-bar__tab {
@media screen and (min-width: $break-large) {
padding: 16px 24px 0;
}
}
}
&__modules {
overflow-y: auto;
flex: 1 1 auto;
display: flex;
flex-flow: column;
@media screen and (max-width: $break-small) {
display: none;
}
}
}
&__body {
padding: 12px 24px;
@media screen and (min-width: $break-large) {
padding: 12px;
}
}
&__content-row {
display: flex;
flex-direction: column;
padding: 10px 0 20px;
}
&__content-item {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
margin-bottom: 20px;
@media screen and (max-width: $break-small) {
height: initial;
padding: 5px 0;
}
&--without-height {
height: initial;
}
&--disabled {
cursor: not-allowed;
opacity: 0.5;
}
}
&__content-label {
text-transform: capitalize;
}
&__content-description {
@include H6;
color: $dusty-gray;
padding-top: 5px;
}
&__content-item-col {
max-width: 300px;
display: flex;
flex-direction: column;
@media screen and (max-width: $break-small) {
max-width: 100%;
width: 100%;
}
}
&__copy-icon {
padding-left: 4px;
}
&__button-group {
display: flex;
margin-left: auto;
}
&__address-book-button {
@include H5;
padding: 0;
}
&__address-book-button + &__address-book-button {
margin-left: 1.875rem;
}
&__inline-link {
@include H6;
display: initial;
padding: 0;
}
&--selected {
.settings-page {
&__content {
&__tabs {
@media screen and (max-width: $break-small) {
display: none;
}
}
&__modules {
@media screen and (max-width: $break-small) {
display: block;
}
}
}
}
}
.toggle-button {
/*rtl:ignore*/
direction: ltr;
[dir='rtl'] & {
justify-content: flex-end;
}
}
}