-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit NFTL multi-claim to only Degens with claimable balance
- Loading branch information
Showing
11 changed files
with
191 additions
and
156 deletions.
There are no files selected for viewing
43 changes: 8 additions & 35 deletions
43
apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/DegenBalance.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
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
38 changes: 7 additions & 31 deletions
38
apps/app/src/app/_layout/_MainLayout/_Sidebar/_UserProfile/index.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
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
File renamed without changes.
42 changes: 42 additions & 0 deletions
42
apps/app/src/components/dialog/BridgeButtonDialog/index.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,42 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
import { Button } from '@mui/material'; | ||
import { Dialog, DialogContent, DialogTrigger } from '@/components/dialog'; | ||
import BridgeForm from './BridgeForm'; | ||
import BridgeSuccess from './BridgeSuccess'; | ||
|
||
type BridgeButtonDialogProps = { balance: number; loading: boolean }; | ||
|
||
const BridgeButtonDialog = ({ balance, loading }: BridgeButtonDialogProps) => { | ||
const [successDialogOpen, setSuccessDialogOpen] = useState(false); | ||
|
||
const onCloseBridgeDialog = () => {}; // handle actions if needed | ||
|
||
const onBridgeSuccess = () => setSuccessDialogOpen(true); | ||
|
||
return ( | ||
<> | ||
<Dialog onClose={onCloseBridgeDialog}> | ||
<DialogTrigger> | ||
<Button fullWidth variant="contained" disabled={loading || balance < 0.5}> | ||
Bridge | ||
</Button> | ||
</DialogTrigger> | ||
<DialogContent | ||
aria-labelledby="bridge-nftl-dialog" | ||
dialogTitle="Bridge NFTL to Immutable" | ||
sx={{ | ||
'& h2': { textAlign: 'center' }, | ||
'& .MuiDialogContent-root': { textAlign: 'center' }, | ||
}} | ||
> | ||
<BridgeForm balance={balance} onBridgeSuccess={onBridgeSuccess} /> | ||
</DialogContent> | ||
</Dialog> | ||
<BridgeSuccess successDialogOpen={successDialogOpen} setSuccessDialogOpen={setSuccessDialogOpen} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default BridgeButtonDialog; |
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
File renamed without changes.
56 changes: 56 additions & 0 deletions
56
apps/app/src/components/dialog/WithdrawButtonDialog/index.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,56 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
import { Badge, Button } from '@mui/material'; | ||
import { useSwitchChain } from 'wagmi'; | ||
|
||
import { TARGET_NETWORK } from '@/constants/networks'; | ||
import { Dialog, DialogContent, DialogTrigger } from '@/components/dialog'; | ||
import WithdrawForm from './WithdrawForm'; | ||
import WithdrawSuccess from './WithdrawSuccess'; | ||
|
||
type WithdrawButtonDialogProps = { balance: number; loading: boolean }; | ||
|
||
const WithdrawButtonDialog = ({ balance, loading }: WithdrawButtonDialogProps) => { | ||
const { switchChain } = useSwitchChain(); | ||
const [successDialogOpen, setSuccessDialogOpen] = useState(false); | ||
|
||
const onCloseWithdrawDialog = () => { | ||
switchChain?.({ chainId: TARGET_NETWORK.chainId }); | ||
}; | ||
|
||
const onWithdrawSuccess = () => setSuccessDialogOpen(true); | ||
|
||
return ( | ||
<> | ||
<Dialog onClose={onCloseWithdrawDialog}> | ||
<DialogTrigger> | ||
<Badge | ||
color="error" | ||
variant="standard" | ||
badgeContent=" " | ||
invisible={loading || balance === 0} | ||
sx={{ width: '100%' }} | ||
> | ||
<Button fullWidth variant="contained" disabled={loading || balance === 0}> | ||
Withdraw | ||
</Button> | ||
</Badge> | ||
</DialogTrigger> | ||
<DialogContent | ||
aria-labelledby="withdraw-earnings-dialog" | ||
dialogTitle="Withdraw Earnings" | ||
sx={{ | ||
'& h2': { textAlign: 'center' }, | ||
'& .MuiDialogContent-root': { textAlign: 'center' }, | ||
}} | ||
> | ||
<WithdrawForm balance={balance} onWithdrawSuccess={onWithdrawSuccess} /> | ||
</DialogContent> | ||
</Dialog> | ||
<WithdrawSuccess successDialogOpen={successDialogOpen} setSuccessDialogOpen={setSuccessDialogOpen} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default WithdrawButtonDialog; |
Oops, something went wrong.