From 3bb55c6b5d916fa7d9e7c5faa4428036dba5d353 Mon Sep 17 00:00:00 2001 From: eddie <66155195+just-toby@users.noreply.github.com> Date: Wed, 27 Sep 2023 10:47:16 -0700 Subject: [PATCH] fix: hide price when no amount input (#7379) * fix: hide price when no amount input * fix: snapshots --- .../Landing/__snapshots__/index.test.tsx.snap | 998 ++++++++---------- src/pages/Swap/index.tsx | 6 +- 2 files changed, 444 insertions(+), 560 deletions(-) diff --git a/src/pages/Landing/__snapshots__/index.test.tsx.snap b/src/pages/Landing/__snapshots__/index.test.tsx.snap index 0b38ad7a8d..b885567047 100644 --- a/src/pages/Landing/__snapshots__/index.test.tsx.snap +++ b/src/pages/Landing/__snapshots__/index.test.tsx.snap @@ -30,7 +30,7 @@ exports[`disable nft on landing page does not render nft information and card 1` border-radius: 4px; } -.c50 { +.c47 { box-sizing: border-box; margin: 0; min-width: 0; @@ -71,24 +71,6 @@ exports[`disable nft on landing page does not render nft information and card 1` justify-content: flex-start; } -.c49 { - width: 100%; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - padding: 0; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: start; - -webkit-justify-content: flex-start; - -ms-flex-pack: start; - justify-content: flex-start; - gap: 8px; -} - .c9 { -webkit-box-pack: justify; -webkit-justify-content: space-between; @@ -110,7 +92,7 @@ exports[`disable nft on landing page does not render nft information and card 1` color: #7D7D7D; } -.c102 { +.c99 { -webkit-text-decoration: none; text-decoration: none; cursor: pointer; @@ -121,15 +103,15 @@ exports[`disable nft on landing page does not render nft information and card 1` font-weight: 500; } -.c102:hover { +.c99:hover { opacity: 0.6; } -.c102:active { +.c99:active { opacity: 0.4; } -.c100 { +.c97 { -webkit-text-decoration: none; text-decoration: none; cursor: pointer; @@ -140,36 +122,36 @@ exports[`disable nft on landing page does not render nft information and card 1` font-weight: 500; } -.c100:hover { +.c97:hover { opacity: 0.6; } -.c100:active { +.c97:active { opacity: 0.4; } -.c93 { +.c90 { height: 32px; width: 32px; fill: #98A1C0; opacity: 1; } -.c94 { +.c91 { height: 32px; width: 32px; fill: #98A1C0; opacity: 1; } -.c95 { +.c92 { height: 32px; width: 32px; fill: #98A1C0; opacity: 1; } -.c87 { +.c84 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -182,7 +164,7 @@ exports[`disable nft on landing page does not render nft information and card 1` max-width: 1440px; } -.c88 { +.c85 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -192,24 +174,24 @@ exports[`disable nft on landing page does not render nft information and card 1` flex-direction: column; } -.c89 { +.c86 { display: none; } -.c104 { +.c101 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; } -.c90 { +.c87 { width: 72px; height: 72px; display: none; } -.c91 { +.c88 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -222,20 +204,20 @@ exports[`disable nft on landing page does not render nft information and card 1` margin: 20px 0 0 0; } -.c92 { +.c89 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; } -.c97 { +.c94 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } -.c98 { +.c95 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -248,32 +230,32 @@ exports[`disable nft on landing page does not render nft information and card 1` margin: 20px 0 0 0; } -.c99 { +.c96 { font-size: 16px; line-height: 20px; font-weight: 535; } -.c103 { +.c100 { font-size: 16px; line-height: 20px; color: #7D7D7D; } -.c101 { +.c98 { font-size: 16px; line-height: 20px; color: #7D7D7D; } -.c96 { +.c93 { font-size: 16px; line-height: 20px; margin: 1rem 0 0 0; color: #CECECE; } -.c70 { +.c67 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -301,11 +283,11 @@ exports[`disable nft on landing page does not render nft information and card 1` transition: 250ms ease border; } -.c70:hover { +.c67:hover { border: 1px solid #CECECE; } -.c76 { +.c73 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -333,11 +315,11 @@ exports[`disable nft on landing page does not render nft information and card 1` transition: 250ms ease border; } -.c76:hover { +.c73:hover { border: 1px solid #CECECE; } -.c71 { +.c68 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -352,13 +334,13 @@ exports[`disable nft on landing page does not render nft information and card 1` justify-content: space-between; } -.c72 { +.c69 { font-size: 20px; line-height: 28px; font-weight: 535; } -.c73 { +.c70 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -373,7 +355,7 @@ exports[`disable nft on landing page does not render nft information and card 1` max-width: 480px; } -.c77 { +.c74 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -388,7 +370,7 @@ exports[`disable nft on landing page does not render nft information and card 1` max-width: 480px; } -.c74 { +.c71 { color: #FC72FF; font-weight: 535; margin: 24px 0 0; @@ -397,18 +379,18 @@ exports[`disable nft on landing page does not render nft information and card 1` transition: 250ms ease opacity; } -.c74:hover { +.c71:hover { opacity: 0.6; } -.c78 { +.c75 { min-width: 20px; min-height: 20px; max-height: 48px; max-width: 48px; } -.c53 { +.c50 { background-color: transparent; bottom: 0; border-radius: inherit; @@ -479,7 +461,7 @@ exports[`disable nft on landing page does not render nft information and card 1` text-decoration: none; } -.c84 { +.c81 { padding: 16px; width: 200px; line-height: 24px; @@ -518,58 +500,58 @@ exports[`disable nft on landing page does not render nft information and card 1` transform: perspective(1px) translateZ(0); } -.c84:disabled { +.c81:disabled { opacity: 50%; cursor: auto; pointer-events: none; } -.c84 > * { +.c81 > * { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } -.c84 > a { +.c81 > a { -webkit-text-decoration: none; text-decoration: none; } -.c51 { +.c48 { background-color: #FFEFFF; color: #FC72FF; font-size: 20px; font-weight: 535; } -.c51:focus { +.c48:focus { box-shadow: 0 0 0 1pt #FFEFFF; background-color: #FFEFFF; } -.c51:hover { +.c48:hover { background-color: #FFEFFF; } -.c51:active { +.c48:active { box-shadow: 0 0 0 1pt #FFEFFF; background-color: #FFEFFF; } -.c51:hover .c52 { +.c48:hover .c49 { background-color: #98A1C014; } -.c51:active .c52 { +.c48:active .c49 { background-color: #B8C0DC3d; } -.c51:disabled { +.c48:disabled { opacity: 0.4; } -.c51:disabled:hover { +.c48:disabled:hover { cursor: auto; background-color: transparent; box-shadow: none; @@ -593,7 +575,7 @@ exports[`disable nft on landing page does not render nft information and card 1` background-color: #e0e0e0; } -.c85 { +.c82 { background-color: transparent; color: #FC72FF; display: -webkit-box; @@ -610,22 +592,22 @@ exports[`disable nft on landing page does not render nft information and card 1` align-items: center; } -.c85:focus { +.c82:focus { -webkit-text-decoration: underline; text-decoration: underline; } -.c85:hover { +.c82:hover { -webkit-text-decoration: none; text-decoration: none; } -.c85:active { +.c82:active { -webkit-text-decoration: none; text-decoration: none; } -.c85:disabled { +.c82:disabled { opacity: 50%; cursor: auto; } @@ -659,7 +641,7 @@ exports[`disable nft on landing page does not render nft information and card 1` cursor: auto; } -.c79 { +.c76 { height: 340px; width: 100%; border-radius: 32px; @@ -685,7 +667,7 @@ exports[`disable nft on landing page does not render nft information and card 1` background: url(Mesh.png),linear-gradient(93.06deg,#FF00C7 2.66%,#FF9FFB 98.99%); } -.c80 { +.c77 { color: white; display: -webkit-box; display: -webkit-flex; @@ -699,20 +681,20 @@ exports[`disable nft on landing page does not render nft information and card 1` flex-direction: column; } -.c81 { +.c78 { font-weight: 535; font-size: 28px; line-height: 36px; } -.c82 { +.c79 { margin: 10px 10px 0 0; font-weight: 535; font-size: 16px; line-height: 20px; } -.c83 { +.c80 { width: 100%; display: -webkit-box; display: -webkit-flex; @@ -726,16 +708,16 @@ exports[`disable nft on landing page does not render nft information and card 1` transition: 250ms ease opacity; } -.c83:hover { +.c80:hover { opacity: 0.6; } -.c86 { +.c83 { color: white; border: 1px solid white; } -.c45 { +.c43 { display: grid; grid-auto-rows: auto; grid-row-gap: 4px; @@ -749,21 +731,6 @@ exports[`disable nft on landing page does not render nft information and card 1` transition: opacity 250ms ease-in-out; } -.c41 { - border-radius: 12px; - border-radius: 12px; - height: 24px; - width: 50%; - width: 50%; - -webkit-animation: fAQEyV 1.5s infinite; - animation: fAQEyV 1.5s infinite; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - background: linear-gradient( to left, #22222212 25%, rgba(53,53,53,0.07) 50%, #22222212 75% ); - will-change: background-position; - background-size: 400%; -} - .c14 { display: inline-block; height: inherit; @@ -846,12 +813,6 @@ exports[`disable nft on landing page does not render nft information and card 1` color: #CECECE; } -.c42 { - border-radius: 4px; - width: 4rem; - height: 1rem; -} - .c24 { display: -webkit-box; display: -webkit-flex; @@ -932,7 +893,7 @@ exports[`disable nft on landing page does not render nft information and card 1` background-color: #B8C0DC3d; } -.c47 { +.c45 { -webkit-align-items: center; -webkit-box-align: center; -ms-flex-align: center; @@ -965,12 +926,12 @@ exports[`disable nft on landing page does not render nft information and card 1` animation: none; } -.c47:hover, -.c47:active { +.c45:hover, +.c45:active { background-color: #FC72FF; } -.c47:before { +.c45:before { background-size: 100%; border-radius: inherit; position: absolute; @@ -981,11 +942,11 @@ exports[`disable nft on landing page does not render nft information and card 1` content: ''; } -.c47:hover:before { +.c45:hover:before { background-color: #98A1C014; } -.c47:active:before { +.c45:active:before { background-color: #B8C0DC3d; } @@ -1065,13 +1026,13 @@ exports[`disable nft on landing page does not render nft information and card 1` stroke-width: 2px; } -.c48 { +.c46 { margin: 0 0.25rem 0 0.35rem; height: 35%; margin-left: 8px; } -.c48 path { +.c46 path { stroke: #FFFFFF; stroke-width: 2px; } @@ -1139,7 +1100,7 @@ exports[`disable nft on landing page does not render nft information and card 1` padding-top: 12px; } -.c43 { +.c41 { border-radius: 12px; height: 40px; width: 40px; @@ -1154,7 +1115,7 @@ exports[`disable nft on landing page does not render nft information and card 1` z-index: 2; } -.c43:hover { +.c41:hover { cursor: pointer; opacity: 0.8; } @@ -1216,7 +1177,7 @@ exports[`disable nft on landing page does not render nft information and card 1` gap: 16px; } -.c44 { +.c42 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -1267,7 +1228,7 @@ exports[`disable nft on landing page does not render nft information and card 1` border-color: #B8C0DC3d; } -.c46 { +.c44 { border-bottom: 1px solid #FFFFFF; } @@ -1294,7 +1255,7 @@ exports[`disable nft on landing page does not render nft information and card 1` overflow-x: hidden; } -.c54 { +.c51 { position: absolute; display: -webkit-box; display: -webkit-flex; @@ -1318,7 +1279,7 @@ exports[`disable nft on landing page does not render nft information and card 1` height: calc(100vh - 48px); } -.c55 { +.c52 { position: absolute; display: -webkit-box; display: -webkit-flex; @@ -1339,7 +1300,7 @@ exports[`disable nft on landing page does not render nft information and card 1` height: calc(100vh - 48px); } -.c56 { +.c53 { position: absolute; top: 68px; bottom: 0; @@ -1352,7 +1313,7 @@ exports[`disable nft on landing page does not render nft information and card 1` height: 100%; } -.c57 { +.c54 { position: absolute; display: -webkit-box; display: -webkit-flex; @@ -1380,11 +1341,11 @@ exports[`disable nft on landing page does not render nft information and card 1` pointer-events: none; } -.c57 * { +.c54 * { pointer-events: auto; } -.c58 { +.c55 { color: transparent; font-size: 36px; line-height: 44px; @@ -1396,7 +1357,7 @@ exports[`disable nft on landing page does not render nft information and card 1` -webkit-background-clip: text; } -.c60 { +.c57 { color: #7D7D7D; font-size: 16px; line-height: 24px; @@ -1406,7 +1367,7 @@ exports[`disable nft on landing page does not render nft information and card 1` margin: 0 0 32px; } -.c59 { +.c56 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -1417,12 +1378,12 @@ exports[`disable nft on landing page does not render nft information and card 1` justify-content: center; } -.c62 { +.c59 { padding: 16px 0px; border-radius: 24px; } -.c63 { +.c60 { background: linear-gradient(93.06deg,#ff00c7 2.66%,#ff9ffb 98.99%); border: none; color: #FFFFFF; @@ -1430,24 +1391,24 @@ exports[`disable nft on landing page does not render nft information and card 1` transition: all 250ms ease; } -.c63:hover { +.c60:hover { box-shadow: 0px 0px 16px 0px #ff00c7; } -.c64 { +.c61 { margin: 0px; font-size: 16px; font-weight: 535; white-space: nowrap; } -.c61 { +.c58 { max-width: 300px; width: 100%; pointer-events: auto; } -.c65 { +.c62 { -webkit-align-items: center; -webkit-box-align: center; -ms-flex-align: center; @@ -1467,16 +1428,16 @@ exports[`disable nft on landing page does not render nft information and card 1` transition: 250ms ease opacity; } -.c65:hover { +.c62:hover { opacity: 0.6; } -.c66 { +.c63 { margin-left: 14px; size: 20px; } -.c68 { +.c65 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -1493,7 +1454,7 @@ exports[`disable nft on landing page does not render nft information and card 1` background: linear-gradient(179.82deg,rgba(255,255,255,0) 0.16%,#eaeaea 99.85%); } -.c69 { +.c66 { display: grid; gap: 12px; width: 100%; @@ -1506,7 +1467,7 @@ exports[`disable nft on landing page does not render nft information and card 1` grid-template-columns: 1fr; } -.c75 { +.c72 { display: grid; gap: 12px; width: 100%; @@ -1560,7 +1521,7 @@ exports[`disable nft on landing page does not render nft information and card 1` width: 100%; } -.c67 { +.c64 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -1576,12 +1537,12 @@ exports[`disable nft on landing page does not render nft information and card 1` text-align: center; } -.c67:hover { +.c64:hover { color: #CECECE; } @media screen and (min-width:1024px) { - .c87 { + .c84 { -webkit-flex-direction: row; -ms-flex-direction: row; flex-direction: row; @@ -1593,7 +1554,7 @@ exports[`disable nft on landing page does not render nft information and card 1` } @media screen and (min-width:1024px) { - .c89 { + .c86 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -1602,63 +1563,63 @@ exports[`disable nft on landing page does not render nft information and card 1` } @media screen and (min-width:1024px) { - .c104 { + .c101 { display: none; } } @media screen and (min-width:1024px) { - .c90 { + .c87 { display: block; } } @media screen and (min-width:1280px) { - .c97 { + .c94 { grid-template-columns: 1fr 1fr 1fr 1fr; gap: 24px; } } @media screen and (min-width:1280px) { - .c98 { + .c95 { margin: 0; } } @media screen and (min-width:640px) { - .c70 { + .c67 { height: 360px; } } @media screen and (min-width:1280px) { - .c70 { + .c67 { padding: 32px; } } @media screen and (min-width:640px) { - .c76 { + .c73 { height: 260px; } } @media screen and (min-width:1280px) { - .c76 { + .c73 { padding: 32px; } } @media screen and (min-width:1024px) { - .c72 { + .c69 { font-size: 28px; line-height: 36px; } } @media screen and (min-width:1280px) { - .c73 { + .c70 { font-size: 20px; line-height: 28px; max-width: 480px; @@ -1666,7 +1627,7 @@ exports[`disable nft on landing page does not render nft information and card 1` } @media screen and (min-width:1280px) { - .c77 { + .c74 { font-size: 20px; line-height: 28px; max-width: 480px; @@ -1674,7 +1635,7 @@ exports[`disable nft on landing page does not render nft information and card 1` } @media screen and (min-width:1024px) { - .c79 { + .c76 { height: 140px; -webkit-flex-direction: row; -ms-flex-direction: row; @@ -1683,21 +1644,21 @@ exports[`disable nft on landing page does not render nft information and card 1` } @media screen and (min-width:1280px) { - .c81 { + .c78 { font-size: 28px; line-height: 36px; } } @media screen and (min-width:1280px) { - .c82 { + .c79 { font-size: 20px; line-height: 28px; } } @media screen and (min-width:1024px) { - .c83 { + .c80 { width: auto; } } @@ -1715,79 +1676,79 @@ exports[`disable nft on landing page does not render nft information and card 1` } @media screen and (min-width:768px) { - .c54 { + .c51 { height: 100vh; } } @media screen and (min-width:768px) { - .c55 { + .c52 { height: 100vh; } } @media screen and (min-width:640px) { - .c58 { + .c55 { font-size: 48px; line-height: 56px; } } @media screen and (min-width:768px) { - .c58 { + .c55 { font-size: 64px; line-height: 72px; } } @media screen and (min-width:768px) { - .c60 { + .c57 { font-size: 20px; line-height: 28px; } } @media screen and (min-width:640px) { - .c64 { + .c61 { font-size: 20px; } } @media screen and (min-width:640px) { - .c65 { + .c62 { visibility: visible; } } @media screen and (min-width:768px) { - .c68 { + .c65 { padding: 0 96px 5rem; } } @media screen and (min-width:640px) { - .c69 { + .c66 { grid-template-columns: 1fr; gap: 32px; } } @media screen and (min-width:1024px) { - .c69 { + .c66 { grid-template-columns: 1fr; gap: 32px; } } @media screen and (min-width:640px) { - .c75 { + .c72 { grid-template-columns: 1fr; gap: 32px; } } @media screen and (min-width:1024px) { - .c75 { + .c72 { grid-template-columns: 1fr 1fr 1fr; gap: 32px; } @@ -1963,11 +1924,7 @@ exports[`disable nft on landing page does not render nft information and card 1` >