Skip to content

Commit

Permalink
temporaly rm tvl
Browse files Browse the repository at this point in the history
  • Loading branch information
lilchizh committed Nov 9, 2022
1 parent e1f7fde commit 55c6fce
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
26 changes: 14 additions & 12 deletions src/components/FarmingEventCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function FarmingEventCard({
const rewardList = useMemo(() => {
if (!eternal && (!reward || !bonusReward)) return;

if (eternal && (!dailyRewardRate && !dailyBonusRewardRate)) return;
if (eternal && !dailyRewardRate && !dailyBonusRewardRate) return;

if (rewardToken.id === bonusRewardToken.id) {
return [{ token: rewardToken, rewardRate: (dailyRewardRate || 0) + (dailyBonusRewardRate || 0), amount: formatUnits(BigNumber.from(reward).add(BigNumber.from(bonusReward)), 18) }];
Expand Down Expand Up @@ -238,15 +238,17 @@ export function FarmingEventCard({
<Trans>REWARDS</Trans>
</div>
<ul className="farming-event-card__reward-list">
{rewardList?.map((reward: any, i) => reward.rewardRate ? (
<li key={i} className="farming-event-card__reward-list-item f">
<CurrencyLogo currency={new Token(SupportedChainId.DOGECHAIN, reward.token.id, 18, reward.token.symbol) as WrappedCurrency} size={"30px"} />
<span className="farming-event-card__reward-list-item__symbol ml-05">{reward.token.symbol}</span>
<div className={"m-a mr-0 fs-085"} title={reward.amount.toString()}>
{eternal ? <span>{formatAmountTokens(reward.rewardRate, false)} per day</span> : <span>{formatAmountTokens(reward.amount, false)}</span>}
</div>
</li>
) : null)}
{rewardList?.map((reward: any, i) =>
reward.rewardRate ? (
<li key={i} className="farming-event-card__reward-list-item f">
<CurrencyLogo currency={new Token(SupportedChainId.DOGECHAIN, reward.token.id, 18, reward.token.symbol) as WrappedCurrency} size={"30px"} />
<span className="farming-event-card__reward-list-item__symbol ml-05">{reward.token.symbol}</span>
<div className={"m-a mr-0 fs-085"} title={reward.amount.toString()}>
{eternal ? <span>{formatAmountTokens(reward.rewardRate, false)} per day</span> : <span>{formatAmountTokens(reward.amount, false)}</span>}
</div>
</li>
) : null
)}
</ul>
</div>
{!eternal && (
Expand Down Expand Up @@ -303,10 +305,10 @@ export function FarmingEventCard({
)}
{account && !active ? (
<>
<div style={{ marginTop: "9px", border: "none", lineHeight: "19px" }} className={`w-100 b br-8 fs-085 ${!eternal ? "mt-05" : ""}`}>
{/* <div style={{ marginTop: "9px", border: "none", lineHeight: "19px" }} className={`w-100 b br-8 fs-085 ${!eternal ? "mt-05" : ""}`}>
<span>TVL : </span>
<span>{formatDollarAmount(tvl)}</span>
</div>
</div> */}
<button
style={{ marginTop: "9px", border: "none", lineHeight: "19px", height: "36px" }}
//@ts-ignore
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useFarmingSubgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ export function useFarmingSubgraph() {

async function fetchEternalFarms(reload: boolean) {

if (!ethPrices) return
// if (!ethPrices) return

setEternalFarmsLoading(true)

Expand Down Expand Up @@ -759,7 +759,7 @@ export function useFarmingSubgraph() {
const dailyBonusRewardRate = Math.round(+_bonusRewardRate * 86_400)

const apr = aprs[farming.id] ? aprs[farming.id] : 200
const tvl = eventTVL[farming.id] ? Math.round(eventTVL[farming.id] * ethPrices.current) : 0
// const tvl = eventTVL[farming.id] ? Math.round(eventTVL[farming.id] * ethPrices.current) : 0

_eternalFarmings = [
//@ts-ignore
Expand All @@ -774,7 +774,7 @@ export function useFarmingSubgraph() {
//@ts-ignore
pool,
apr,
tvl
tvl: 0
}
]

Expand Down
8 changes: 4 additions & 4 deletions src/pages/EternalFarmsPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import "./index.scss";

import { Trans } from "@lingui/macro";

export default function EternalFarmsPage({ data, refreshing, priceFetched, fetchHandler }: { data: any; refreshing: boolean; priceFetched: boolean, fetchHandler: () => any }) {
export default function EternalFarmsPage({ data, refreshing, priceFetched, fetchHandler }: { data: any; refreshing: boolean; priceFetched: boolean; fetchHandler: () => any }) {
const [modalForPool, setModalForPool] = useState(null);

useEffect(() => {
if (priceFetched) {
fetchHandler();
}
// if (priceFetched) {
fetchHandler();
// }
}, [priceFetched]);

return (
Expand Down

0 comments on commit 55c6fce

Please sign in to comment.