Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bca4044
commit bc876ce
Showing
7 changed files
with
109 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.ledgerButton { | ||
margin-top: 8px !important; | ||
} |
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
7 changes: 7 additions & 0 deletions
7
app/frontend/components/pages/login/ledgerTransportationSelect.module.scss
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,7 @@ | ||
.dropdown { | ||
margin-top: 16px; | ||
} | ||
|
||
.label { | ||
width: 5.5em; | ||
} |
36 changes: 36 additions & 0 deletions
36
app/frontend/components/pages/login/ledgerTransportationSelect.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,36 @@ | ||
import {h} from 'preact' | ||
import SearchableSelect from '../../common/searchableSelect' | ||
import {LedgerTransportType} from '../../../../frontend/types' | ||
import styles from './ledgerTransportationSelect.module.scss' | ||
|
||
interface Props { | ||
onSelect: (ledgerTransportType: LedgerTransportType) => void | ||
} | ||
|
||
const LedgerTransportationSelect = ({onSelect}: Props) => { | ||
const dropdownAssetItems = [ | ||
LedgerTransportType.DEFAULT, | ||
LedgerTransportType.U2F, | ||
LedgerTransportType.WEB_USB, | ||
LedgerTransportType.WEB_HID, | ||
] | ||
|
||
const displayItem = (item: LedgerTransportType) => <div>{item}</div> | ||
|
||
return ( | ||
<SearchableSelect | ||
label="Transport" | ||
labelClassName={styles.label} | ||
wrapperClassName="no-margin" | ||
defaultItem={LedgerTransportType.DEFAULT} | ||
displaySelectedItem={displayItem} | ||
displaySelectedItemClassName={`input dropdown ${styles.dropdown}`} | ||
items={dropdownAssetItems} | ||
displayItem={displayItem} | ||
onSelect={onSelect} | ||
showSearch={false} | ||
/> | ||
) | ||
} | ||
|
||
export default LedgerTransportationSelect |
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