Small layout tweaks

This commit is contained in:
Marco van Dijk 2022-03-04 20:25:12 +01:00
parent afc0474a39
commit e7302b1828

View File

@ -235,6 +235,8 @@ const EventButton = (obj) => {
// Displays info specific to a type of transactions // Displays info specific to a type of transactions
let eventSpecificInfo; let eventSpecificInfo;
let eventTo;
let eventFrom;
if (transactionName === "Reward") { if (transactionName === "Reward") {
if (transactionAmount - 69 < 1 && transactionAmount - 69 > 0) { if (transactionAmount - 69 < 1 && transactionAmount - 69 > 0) {
eventSpecificInfo = eventSpecificInfo =
@ -265,9 +267,9 @@ const EventButton = (obj) => {
} }
eventSpecificInfo = eventSpecificInfo =
<div className="rowAlignLeft"> <div className="rowAlignLeft">
<p>{claimString} at </p> <p>{claimString} at</p>
<button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionFrom)) }} >{transactionFrom}</button>
</div> </div>
eventFrom = <button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionFrom)) }} >{transactionFrom}</button>;
} else if (transactionName === "Update") { } else if (transactionName === "Update") {
eventSpecificInfo = eventSpecificInfo =
<div className="rowAlignLeft"> <div className="rowAlignLeft">
@ -276,40 +278,39 @@ const EventButton = (obj) => {
} else if (transactionName === "Unbond") { } else if (transactionName === "Unbond") {
eventSpecificInfo = eventSpecificInfo =
<div className="rowAlignLeft"> <div className="rowAlignLeft">
<p> unbonded {transactionAmount.toFixed(2)} LPT from {transactionFrom} starting from round {transactionWhen}</p> <p>unbonded {transactionAmount.toFixed(2)} LPT starting from round {transactionWhen}</p>
</div> </div>
eventFrom = <button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionFrom)) }} >{transactionFrom}</button>;
} else if (transactionName === "Stake") { } else if (transactionName === "Stake") {
eventTo = <button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionTo)) }} >{transactionTo}</button>;
if (transactionFrom == "0x0000000000000000000000000000000000000000") { if (transactionFrom == "0x0000000000000000000000000000000000000000") {
eventSpecificInfo = eventSpecificInfo =
<div className="rowAlignLeft"> <div className="rowAlignLeft">
<p> staked {transactionAmount.toFixed(2)} LPT to </p> <p> staked {transactionAmount.toFixed(2)} LPT to </p>
<button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionTo)) }} >{transactionTo}</button>
</div> </div>
} else { } else {
eventFrom = <button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionFrom)) }} >{transactionFrom}</button>;
eventSpecificInfo = eventSpecificInfo =
<div className="rowAlignLeft"> <div className="rowAlignLeft">
<p> moved {transactionAmount.toFixed(2)} LPT stake: </p> <p>moved {transactionAmount.toFixed(2)} LPT stake</p>
<button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionFrom)) }} >{transactionFrom}</button>
<p> to </p>
<button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionTo)) }} >{transactionTo}</button>
</div> </div>
} }
} else if (transactionName === "Rebond") { } else if (transactionName === "Rebond") {
eventTo = <button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionTo)) }} >{transactionTo}</button>;
eventSpecificInfo = eventSpecificInfo =
<div className="rowAlignLeft"> <div className="rowAlignLeft">
<p> increased their stake with {transactionAmount.toFixed(2)} LPT at </p> <p>increased their stake with {transactionAmount.toFixed(2)} LPT at</p>
<button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionTo)) }} >{transactionTo}</button>
</div> </div>
} else if (transactionName === "Migrate") { } else if (transactionName === "Migrate") {
eventTo = <button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionTo)) }} >{transactionTo}</button>;
eventSpecificInfo = eventSpecificInfo =
<div className="rowAlignLeft"> <div className="rowAlignLeft">
<p> migrated {transactionAmount.toFixed(2)} LPT to L2 at </p> <p>migrated {transactionAmount.toFixed(2)} LPT to L2 at</p>
<button className="selectOrch" onClick={() => { dispatch(getOrchestratorInfo(transactionTo)) }} >{transactionTo}</button>
</div> </div>
} else if (transactionName === "Withdraw") { } else if (transactionName === "Withdraw") {
eventSpecificInfo = eventSpecificInfo =
<div className="rowAlignLeft"> <div className="rowAlignLeft">
<p> withdrew {(transactionAmount).toFixed(2)} LPT in round {transactionWhen}</p> <p>withdrew {(transactionAmount).toFixed(2)} LPT in round {transactionWhen}</p>
</div> </div>
} else if (transactionName === "Activated") { } else if (transactionName === "Activated") {
if (hasBondTransaction) { if (hasBondTransaction) {
@ -332,6 +333,10 @@ const EventButton = (obj) => {
// IF ON MOBILE // IF ON MOBILE
// transactionCaller.substring(0,8)+"..." // transactionCaller.substring(0,8)+"..."
let eventArrow;
if(eventTo && eventFrom){
eventArrow = <p></p>;
}
return ( return (
<div className="row" style={{ backgroundColor: thisColour, borderRadius: "1.2em" }}> <div className="row" style={{ backgroundColor: thisColour, borderRadius: "1.2em" }}>
@ -344,6 +349,9 @@ const EventButton = (obj) => {
</div> </div>
</div> </div>
{eventSpecificInfo} {eventSpecificInfo}
{eventTo}
{eventArrow}
{eventFrom}
<a href={thisURL}> <a href={thisURL}>
<img alt="" src="arb.svg" width="30" height="30" /> <img alt="" src="arb.svg" width="30" height="30" />
</a> </a>