From 188c1ff95d92679d4bd77b83afd02d5a70b0e5bf Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Fri, 26 Apr 2024 05:09:07 +0200 Subject: [PATCH 1/2] Change transaction layout to accommodate large numbers in extension --- .changelog/2003.trivial.md | 1 + src/app/components/Transaction/index.tsx | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .changelog/2003.trivial.md diff --git a/.changelog/2003.trivial.md b/.changelog/2003.trivial.md new file mode 100644 index 0000000000..fc22f54916 --- /dev/null +++ b/.changelog/2003.trivial.md @@ -0,0 +1 @@ +Change transaction layout to accommodate large numbers in extension diff --git a/src/app/components/Transaction/index.tsx b/src/app/components/Transaction/index.tsx index 74aa6249d2..f129f444ab 100644 --- a/src/app/components/Transaction/index.tsx +++ b/src/app/components/Transaction/index.tsx @@ -61,6 +61,7 @@ type TransactionDictionary = { const StyledCardBody = styled(CardBody)` flex-direction: row; + justify-content: space-between; @media only screen and (min-width: ${({ theme }) => // TODO: extend theme global breakpoints with more breakpoints or at least with 1024px. Requires Sidebar refactor and Grommet lib validation @@ -428,7 +429,7 @@ export function Transaction(props: TransactionProps) { - + {isMobile && ( @@ -443,7 +444,7 @@ export function Transaction(props: TransactionProps) { )} {!isMobile && ( - + {otherAddress ? ( @@ -483,8 +484,13 @@ export function Transaction(props: TransactionProps) { )} - - + + {(() => { switch (transaction.status) { From 837f0af27355ee35edd6199a78d6dd358e11283a Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Sat, 13 Jul 2024 02:26:06 +0200 Subject: [PATCH 2/2] Update jest snapshots --- .../__snapshots__/index.test.tsx.snap | 178 +++++++----------- 1 file changed, 72 insertions(+), 106 deletions(-) diff --git a/src/app/components/Transaction/__tests__/__snapshots__/index.test.tsx.snap b/src/app/components/Transaction/__tests__/__snapshots__/index.test.tsx.snap index 730c7ceb8a..35c59fc4ba 100644 --- a/src/app/components/Transaction/__tests__/__snapshots__/index.test.tsx.snap +++ b/src/app/components/Transaction/__tests__/__snapshots__/index.test.tsx.snap @@ -147,7 +147,6 @@ exports[` should handle unknown transaction types gracefully 1`] -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; - width: 75%; } .c9 { @@ -231,21 +230,7 @@ exports[` should handle unknown transaction types gracefully 1`] justify-content: center; } -.c15 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - box-sizing: border-box; - max-width: 100%; - min-width: 0; - min-height: 0; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; -} - -.c18 { +.c17 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -260,28 +245,22 @@ exports[` should handle unknown transaction types gracefully 1`] padding: 12px; } -.c19 { +.c18 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; box-sizing: border-box; max-width: 100%; - margin-top: 6px; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; min-width: 0; min-height: 0; -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; - width: 25%; padding-right: 12px; } -.c23 { +.c22 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -317,7 +296,7 @@ exports[` should handle unknown transaction types gracefully 1`] width: 12px; } -.c24 { +.c23 { box-sizing: border-box; display: -webkit-inline-box; display: -webkit-inline-flex; @@ -332,7 +311,7 @@ exports[` should handle unknown transaction types gracefully 1`] cursor: pointer; } -.c24:hover { +.c23:hover { -webkit-text-decoration: underline; text-decoration: underline; } @@ -340,8 +319,11 @@ exports[` should handle unknown transaction types gracefully 1`] .c8 { display: grid; box-sizing: border-box; - grid-template-columns: repeat( auto-fit,minmax(min(96px,100%),1fr) ); + grid-template-columns: repeat( 2,minmax(max-content,1fr) ); grid-gap: 0px 0px; + width: -webkit-max-content; + width: -moz-max-content; + width: max-content; } .c4 { @@ -357,37 +339,40 @@ exports[` should handle unknown transaction types gracefully 1`] font-weight: bold; } -.c17 { +.c16 { font-size: 18px; line-height: 24px; } -.c20 { +.c19 { + margin-bottom: 6px; font-size: 26px; line-height: 32px; + text-align: right; font-weight: bold; } -.c21 { +.c20 { font-size: 12px; line-height: 18px; color: ticker; font-weight: 600; } -.c22 { +.c21 { font-size: 14px; line-height: 20px; + text-align: right; color: successful-label; font-weight: bold; } -.c25 { +.c24 { font-size: 14px; line-height: 20px; } -.c16 { +.c15 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -405,6 +390,10 @@ exports[` should handle unknown transaction types gracefully 1`] -webkit-flex-direction: row; -ms-flex-direction: row; flex-direction: row; + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; } @media only screen and (max-width:768px) { @@ -462,19 +451,13 @@ exports[` should handle unknown transaction types gracefully 1`] } @media only screen and (max-width:768px) { - .c18 { + .c17 { padding: 6px; } } @media only screen and (max-width:768px) { - .c19 { - margin-top: 3px; - } -} - -@media only screen and (max-width:768px) { - .c19 { + .c18 { padding-right: 6px; } } @@ -573,10 +556,10 @@ exports[` should handle unknown transaction types gracefully 1`] account.transaction.unrecognizedTransaction.destination
source @@ -617,7 +600,7 @@ exports[` should handle unknown transaction types gracefully 1`] common.hash ff1234 @@ -628,7 +611,7 @@ exports[` should handle unknown transaction types gracefully 1`] class="c9" >
should handle unknown transaction types gracefully 1`]
0.001
should handle unknown transaction types gracefully 1`] account.transaction.successful @@ -703,17 +686,17 @@ exports[` should handle unknown transaction types gracefully 1`]