1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 04:46:10 +01:00
metamask-extension/ui/pages/swaps/dropdown-search-list/index.scss
Daniel c3b79bb358
Show custom tokens in Swaps, add a custom token in Swaps (#11200)
* Show custom tokens in Swaps

* Add messages for adding a custom token in Swaps

* Add the first version of importing custom tokens in swaps

* Fix lint rules

* Create a new component: ImportToken

* Remove a pointer cursor from regular heading

* Fix a CSS issue for tokens with long names

* Update a comment

* Don’t return a custom token if it doesn’t have symbol or decimals

* Only search by contract address if nothing was found

* Track “Token Imported” event

* Fix unit tests

* Import tracking for “Token Imported”, increase token icon font size

* Disable token import for Source Token

* Update logic and content for notifications, update tests

* Do not hide a dropdown placeholder on click, so a user can click on a link

* Update a key name

* Update styling for the “danger” type notification in Swaps

* Show either a warning or danger notification based on token verification occurences

* Remove testnets from SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP

* Use the “shouldSearchForImports” prop

* Create a new function for handling token import: “onOpenImportTokenModalClick”

* Filter token duplicities before iterating over tokens

* Use “address” instead of “symbol” for checking uniqueness

* Trigger Build

* Use a new API (/token) to get token data for importing in Swaps

* Temporarily decrese Jest threshold for functions
2021-06-03 13:38:37 -02:30

166 lines
2.8 KiB
SCSS

.dropdown-search-list {
&__search-list-open {
margin: 24px;
box-shadow: none;
border-radius: 6px;
min-height: 297px;
width: 100%;
}
&__token-container {
margin: 0;
min-height: auto;
border: 1px solid #d6d9dc;
box-sizing: border-box;
box-shadow: none;
border-radius: 6px;
width: 100%;
}
&--open {
box-shadow: 0 0 14px rgba(0, 0, 0, 0.18);
border: 1px solid $Grey-100;
}
&__close-area {
position: fixed;
top: 0;
left: 0;
z-index: 1000;
width: 100%;
height: 100%;
}
&__selector-closed-container {
display: flex;
width: 100%;
position: relative;
align-items: center;
max-height: 60px;
transition: 200ms ease-in-out;
border-radius: 6px;
box-shadow: none;
border: 1px solid #d6d9dc;
height: 60px;
&:hover {
background: $Grey-000;
}
}
&__caret {
position: absolute;
right: 16px;
color: $Grey-200;
}
&__selector-closed {
display: flex;
flex-flow: row nowrap;
align-items: center;
padding: 16px 12px;
box-sizing: border-box;
cursor: pointer;
position: relative;
align-items: center;
flex: 1;
height: 60px;
i {
font-size: 1.2em;
}
.dropdown-search-list__item-labels {
width: 56%;
}
}
&__selector-closed-icon {
width: 34px;
height: 34px;
}
&__closed-primary-label {
@include H4;
color: $Black-100;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&__search-list--open {
box-shadow: 0 0 14px rgba(0, 0, 0, 0.18);
border: 1px solid $Grey-100;
}
&__default-dropdown-icon {
width: 34px;
height: 34px;
border-radius: 50%;
background: $Grey-200;
flex: 0 1 auto;
}
&__labels {
display: flex;
justify-content: space-between;
width: 100%;
flex: 1;
}
&__item-labels {
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 8px;
}
&__select-default {
color: $Grey-200;
}
&__placeholder {
@include H6;
padding: 16px;
color: $Grey-500;
min-height: 300px;
position: relative;
z-index: 1002;
background: white;
border-radius: 6px;
min-height: 194px;
overflow: hidden;
text-overflow: ellipsis;
.searchable-item-list__item--add-token {
padding: 8px 0;
}
}
&__loading-item {
transition: 200ms ease-in-out;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: center;
padding: 16px 12px;
box-sizing: border-box;
cursor: pointer;
border-top: 1px solid $Grey-100;
position: relative;
z-index: 1;
background: $white;
}
&__loading-item-text-container {
margin-left: 4px;
}
&__loading-item-text {
font-weight: bold;
}
}