Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
497 changes: 297 additions & 200 deletions components/ffDashboardClaimAll/ffDashboardClaimAllTable.js

Large diffs are not rendered by default.

61 changes: 20 additions & 41 deletions components/ffVest/ffVest.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import React, { useState, useEffect } from "react";
import BigNumber from "bignumber.js";
import classes from "./ffVest.module.css";
import stores from "../../stores";
import { FIXED_FOREX_UPDATED } from "../../stores/constants";
import moment from "moment";

import Lock from "./lock";
import ExistingLock from "./existingLock";
import NoBalances from "./noBalances";
import Unlock from "./unlock";
import Loading from "./loading";

export default function ffVest() {
const [ibff, setIBFF] = useState(null);
const [veIBFF, setVeIBFF] = useState(null);
const [veIBFFOld, setVeIBFFOld] = useState(null);
const [, setVeIBFFOld] = useState(null);

useEffect(() => {
const forexUpdated = () => {
Expand All @@ -33,41 +30,23 @@ export default function ffVest() {
};
}, []);

return (
<>
{!ibff && !veIBFF && <Loading />}
{ibff && veIBFF && BigNumber(ibff.balance).eq(0) && BigNumber(veIBFF.balance).eq(0) && BigNumber(veIBFF.vestingInfo.lockEnds).eq(0) && (
<NoBalances
ibff={
ibff // no ibff or veibff
}
veIBFF={veIBFF}
/>
)}
{ibff && veIBFF && BigNumber(ibff.balance).gt(0) && BigNumber(veIBFF.balance).eq(0) && (
<Lock
ibff={
ibff // has ibff, nothing locked
}
veIBFF={veIBFF}
veIBFFOld={veIBFFOld}
/>
)}
{veIBFF && BigNumber(veIBFF.balance).gt(0) && (
<ExistingLock
ibff={
ibff // lock still valid
}
veIBFF={veIBFF}
veIBFFOld={veIBFFOld}
expired={false}
/>
)}
{
veIBFF && veIBFF.vestingInfo && BigNumber(veIBFF.vestingInfo.lockEnds).lte(moment().unix()) && BigNumber(veIBFF.vestingInfo.lockEnds).gt(0) && (
<Unlock />
) // Lock expired
}
</>
);
const hasSomethingToUnlock = veIBFF && veIBFF.vestingInfo;

if (!ibff || !veIBFF) {
return <Loading />;
}
if (hasSomethingToUnlock) {
return (
<Unlock
ibff={ibff}
veIBFF={veIBFF}
hasExpired={
BigNumber(veIBFF.vestingInfo.lockEnds).lte(moment().unix()) &&
BigNumber(veIBFF.vestingInfo.lockEnds).gt(0)
}
expirationDate={veIBFF.vestingInfo.lockEnds}
/>
);
}
return <NoBalances ibff={ibff} veIBFF={veIBFF} />;
}
15 changes: 11 additions & 4 deletions components/ffVest/ffVest.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}

.contentBox {
background: rgba(104,108,122,0.05);
background: rgba(104, 108, 122, 0.05);
padding: 30px;
border-radius: 5px;
}
Expand Down Expand Up @@ -113,7 +113,6 @@
.actionsContainer {
width: 100%;
margin-top: 10px;

}

.actionButtonText {
Expand Down Expand Up @@ -148,7 +147,7 @@
font-size: 20px !important;
font-weight: bold !important;
padding-bottom: 20px;
border-bottom: 1px solid rgba(104,108,122,0.2);
border-bottom: 1px solid rgba(104, 108, 122, 0.2);
margin-bottom: 20px !important;
}

Expand Down Expand Up @@ -224,6 +223,14 @@
display: flex;
flex: 1;
}
.lockView {
display: flex;
flex: 1;
display: flex;
flex-direction: column;
/* align-items: center; */
/* justify-content: center; */
}

.activeIcon {
height: 10px;
Expand All @@ -245,7 +252,7 @@
justify-content: center;
border-radius: 30px;
font-size: 11px !important;
border: 1px solid rgba(104,108,122,0.2);
border: 1px solid rgba(104, 108, 122, 0.2);
position: absolute;
top: -2px;
right: 3px;
Expand Down
Loading