Skip to content

Commit

Permalink
design updates to tx list
Browse files Browse the repository at this point in the history
  • Loading branch information
almithani committed Dec 16, 2024
1 parent a821815 commit 35f957e
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 68 deletions.
Binary file added public/img/money-bag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/AccountForm/FormThirdStep/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ p {
.form_third_step_label {
font-family: "Poppins", sans-serif;
font-weight: 400;
font-size: 16px;
margin: 0;
font-size: 14px;
margin-bottom: 10px;
text-align: center;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,80 +26,56 @@ const TransactionListItemComponent = ({
}
}, [isActiveItem]);

if(incomeState){
// render the item if it is flagged as income

return (
<div key={id}
data-incomestate={incomeState}
className={itemStyles}
onClick={onClick}
>
<div className={styles.avatar_container}>
<img src={img_url} className={styles.avatar_img} />
<div className={styles.inner_container}>
<p className={styles.avatar_userName}>{tokenLabel}</p>

<p className={styles.income_received}>
<span>
{" "}
<img
style={{ width: "10px" }}
src="./img/inBadge.png"
alt="income"
/>
</span>{" "}
Income
</p>

</div>
</div>
<div>
<p className={styles.crypto}>{crypto}</p>
<p className={styles.currency}>{currency}</p>
function RenderIncomeSwitcher({isIncome=true}) {
if (isIncome) {
return (
<div className={styles.income_switcher}>
<img style={{ width: "20px" }} src="./img/money-bag.png" alt="income" />
<br/>income
</div>
);
}

return (
<div className={styles.income_switcher}>
<img style={{ width: "20px" }} src="./img/x.png" alt="not income" />
<br/>not income
</div>
);
} else if(tokenLabel) {
// if it has a token label then it is an active asset.
// console.log("tokenLabel", tokenLabel);
}

return (
<div key={id}
data-incomestate={incomeState}
className={itemStyles}
onClick={onClick}
>
<RenderIncomeSwitcher isIncome={incomeState} />
<div className={styles.avatar_container}>
<img src={img_url} className={styles.avatar_img} />
<div className={styles.inner_container}>
<p className={styles.avatar_userName}>{tokenLabel}</p>

<p className={styles.income_received}>
<span>
{" "}
<img
style={{ width: "10px" }}
src="./img/close2.svg"
alt="not income"
src="./img/inBadge.png"
alt="income"
/>
</span>{" "}
Not Income
Received
</p>
<p className={styles.avatar_userName}>{tokenLabel}</p>

</div>
</div>
<div>
<div className={styles.currency_values}>
<p className={styles.crypto}>{crypto}</p>
<p className={styles.currency}>{currency}</p>
</div>
</div>
);

} else {
// skip them all
return (<></>);
}
};


Expand Down
49 changes: 33 additions & 16 deletions src/components/AccountForm/TransactionList/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ p {
margin: 0px;
}
.transaction_list_container {
height: 35vh;
height: 45vh;
overflow-x: hidden;
overflow-y: scroll;
padding-right: 10px;
Expand All @@ -18,15 +18,14 @@ p {
background: linear-gradient(90deg, #c02cae 0%, #f62e54 113.54%);
}
.list_item_container {
border-bottom: solid 1px white;
margin: 20px 0;
margin-bottom: 25px;
}
.date {
font-family: "Inter";
font-style: normal;
font-weight: 600;
font-size: 16px;
margin-bottom: 16px;
margin-bottom: 0px;
/* color */
background: linear-gradient(90deg, #c02cae 0%, #f62e54 113.54%);
-webkit-background-clip: text;
Expand All @@ -36,47 +35,59 @@ p {
}
.inner_container {
margin-left: 10px;
font-size: 0.8em;
}
.item_container {
display: flex;
justify-content: space-between;
justify-content: start;
align-items: center;
margin-bottom: 16px;
cursor: pointer;
padding-top: 10px;
padding-top: 0px;
padding-bottom: 10px;
border-radius: 10px;
}
.item_container:hover {
background: rgba(255, 221, 230, 0.2);
}

.income_switcher {
font-size: 0.8em;
text-align:center;
line-height: 0.8em;
flex: 0 0 auto;
width: 50px;
}

.active_item_container {
display: flex;
justify-content: space-between;
justify-items: stretch;
align-items: center;
margin-bottom: 16px;
margin-bottom: 0px;
cursor: pointer;
padding-top: 10px;
padding-bottom: 10px;
padding-bottom: 0px;
border-radius: 10px;
background: rgba(255, 221, 230, 0.2);
}
.avatar_container {
display: flex;
align-items: center;
flex: 1;
text-align: left;
margin-left: 10px
}

.avatar_img {
width: 40px;
height: 40px;
width: 32px;
height: 32px;
border-radius: 100%;
}

.income_received {
font-family: "Roboto";
font-style: normal;
font-weight: 600;
font-weight: normal;
font-size: 12px;
text-decoration-line: underline;
background: linear-gradient(90deg, #c02cae 0%, #f62e54 113.54%);
Expand All @@ -89,21 +100,27 @@ p {
.avatar_userName {
font-family: "Roboto", sans-serif;
font-style: normal;
font-weight: 400;
font-size: 16px;
font-weight: normal;
}

.currency_values {
text-align: right;
font-size: 0.8em;
margin-left: auto; /* Pushes the box to the far right */
flex: 0 0 auto; /* Fixed size, does not grow or shrink */
}

.crypto {
font-family: "Roboto", sans-serif;
font-style: normal;
font-weight: 400;
font-size: 16px;
font-size: 0.9em;
}

.currency {
font-family: "Roboto" sans-serif;
font-weight: 500;
font-size: 10px;
font-size: 0.8em;
text-align: right;

/* color */
Expand Down
6 changes: 1 addition & 5 deletions src/components/AccountForm/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@
color: #222222;
}
.form_inner_container {
width: 80%;
width: 90%;
margin: auto;
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100%;
}

[data-incomestate="false"] {
border-bottom:3px solid red;
}

.form_container form {
width: 100%;
height: auto;
Expand Down
2 changes: 1 addition & 1 deletion src/functions/displayConvertAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ async function assetDataLoop(asset:any, fiat:any, timestamp:any, value:any){


let output = "$"+fiat+" "+(currentPrice*parseFloat(value)).toFixed(2) + " @ " +currentPrice.toFixed(4);

output = "$"+(currentPrice*parseFloat(value)).toFixed(2)+" "+fiat;
// return the price in FIAT terms, based on timestamp
return output;
}
Expand Down

0 comments on commit 35f957e

Please sign in to comment.