-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
136 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...oject/ProjectDashboard/components/NftRewardsPanel/RedeemNftsSection/NftCreditsSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Trans } from '@lingui/macro' | ||
import TooltipIcon from 'components/TooltipIcon' | ||
import ETHAmount from 'components/currency/ETHAmount' | ||
import { BigNumber } from 'ethers' | ||
|
||
export function NftCreditsSection({ credits }: { credits: BigNumber }) { | ||
return ( | ||
<> | ||
<div className="text-sm font-medium text-grey-600 dark:text-slate-50"> | ||
<Trans>Your credits</Trans> | ||
</div> | ||
<div className="font-heading text-xl font-medium dark:text-slate-50"> | ||
<ETHAmount amount={credits} /> credits{' '} | ||
<TooltipIcon | ||
tip={ | ||
<Trans> | ||
You have NFT credits from previous payments. Select NFTs to mint | ||
and use your credits. | ||
</Trans> | ||
} | ||
/> | ||
</div> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { JB721DelegateContractsContext } from 'contexts/NftRewards/JB721DelegateContracts/JB721DelegateContractsContext' | ||
import { BigNumber } from 'ethers' | ||
import useV2ContractReader from 'hooks/v2v3/contractReader/useV2ContractReader' | ||
import { useContext } from 'react' | ||
|
||
/** | ||
* Return the wei amount of unused credits for a given address. | ||
* @example If the user paid 1 ETH and didnt mint a 1 ETH NFT, then they have 1 ETH of unused credits. | ||
* @param address | ||
* @returns | ||
*/ | ||
export function useNftCredits(address: string | undefined) { | ||
const { | ||
contracts: { JB721TieredDelegate }, | ||
} = useContext(JB721DelegateContractsContext) | ||
|
||
return useV2ContractReader<BigNumber>({ | ||
contract: JB721TieredDelegate, | ||
functionName: 'creditsOf', | ||
args: address ? [address] : null, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5261ad3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
juice-interface-goerli – ./
juice-interface-goerli.vercel.app
goerli.juicebox.money
juice-interface-goerli-git-main-peel.vercel.app
juice-interface-goerli-peel.vercel.app
5261ad3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
juice-interface – ./
juice-interface-mainnet.vercel.app
juice-interface-git-main-peel.vercel.app
juice-interface-peel.vercel.app
www.juicebox.money
juicebox.money