1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-12 04:37:13 +01:00
metamask-extension/ui/pages/swaps/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

101 lines
2.0 KiB
SCSS

@import 'actionable-message/index';
@import 'awaiting-swap/index';
@import 'awaiting-signatures/index';
@import 'build-quote/index';
@import 'countdown-timer/index';
@import 'dropdown-input-pair/index';
@import 'dropdown-search-list/index';
@import 'exchange-rate-display/index';
@import 'fee-card/index';
@import 'loading-swaps-quotes/index';
@import 'main-quote-summary/index';
@import 'searchable-item-list/index';
@import 'select-quote-popover/index';
@import 'slippage-buttons/index';
@import 'swaps-footer/index';
@import 'view-quote/index';
@import 'import-token/index';
.swaps {
display: flex;
justify-content: center;
width: 100%;
@media screen and (min-width: 576px) {
z-index: 12;
}
&__container {
display: flex;
flex-flow: column;
align-items: center;
height: 100%;
width: 100%;
overflow-x: hidden;
overflow-y: auto;
@media screen and (min-width: 576px) {
width: 460px;
background: white;
border: 1px solid $Grey-100;
box-shadow: 0 0 7px 0 rgba(0, 0, 0, 0.08);
border-radius: 8px;
height: 620px;
}
}
&__content {
display: flex;
flex-flow: column;
align-items: center;
position: relative;
width: 100%;
height: 100%;
@media screen and (max-width: 576px) {
&--overflow {
overflow: scroll;
}
}
@media screen and (min-width: 576px) {
width: 348px;
}
}
&__title {
@include H5;
font-weight: bold;
color: $Black-100;
margin-top: -5px;
}
&__header {
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
padding-top: 0;
padding-bottom: 16px;
background: $Grey-000;
width: 100%;
position: relative;
@media screen and (min-width: 576px) {
padding-top: 8px;
padding-bottom: 8px;
height: 66px;
}
}
&__header-cancel {
@include H7;
color: $Blue-500;
cursor: pointer;
position: absolute;
right: 24px;
}
}