forked from liftedinit/manifest-app
-
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.
Merge remote-tracking branch 'origin/main' into fix-web3auth
- Loading branch information
Showing
74 changed files
with
3,397 additions
and
4,130 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { UpgradeModal, CancelUpgradeModal } from '@/components/admins/modals'; | ||
import { useCurrentPlan } from '@/hooks/useQueries'; | ||
import { PlanSDKType } from '@liftedinit/manifestjs/dist/codegen/cosmos/upgrade/v1beta1/upgrade'; | ||
import { useState } from 'react'; | ||
|
||
export const ChainUpgrader = ({ admin, address }: { admin: string; address: string }) => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
const [isCancelOpen, setIsCancelOpen] = useState(false); | ||
const { plan, isPlanLoading, refetchPlan } = useCurrentPlan(); | ||
|
||
if (isPlanLoading) { | ||
return ( | ||
<div className="w-full md:w-1/2 h-full bg-secondary relative rounded-lg p-6 flex flex-col gap-4 shadow-lg animate-pulse"> | ||
<div className="absolute top-4 right-4"> | ||
<div className="skeleton h-4 w-32"></div> | ||
</div> | ||
<div className="space-y-2"> | ||
<div className="skeleton h-7 w-64"></div> | ||
<div className="skeleton h-4 w-full"></div> | ||
</div> | ||
<div className="flex flex-row w-full justify-between gap-4 mt-4"> | ||
<div className="skeleton h-10 flex-1"></div> | ||
<div className="skeleton h-10 flex-1"></div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="w-full md:w-1/2 h-full bg-secondary relative rounded-lg p-6 flex flex-col gap-4 shadow-lg"> | ||
<div className="absolute top-4 right-4"> | ||
<p className={`text-xs ${plan ? 'text-success' : 'text-content'}`}> | ||
{plan ? 'Upgrade in progress' : 'No upgrade in progress'} | ||
</p> | ||
</div> | ||
<div className="space-y-2"> | ||
<h1 className="text-xl font-bold text-secondary-content">Submit Chain Upgrade Proposal</h1> | ||
<p className="text-secondary-content/80 text-sm"> | ||
Submit a proposal to instantiate a chain upgrade. | ||
</p> | ||
</div> | ||
|
||
<div className="flex flex-row w-full justify-between gap-4 mt-4"> | ||
<button | ||
disabled={!!plan} | ||
onClick={() => setIsOpen(true)} | ||
className="btn btn-primary flex-1" | ||
> | ||
Upgrade Chain | ||
</button> | ||
<button | ||
disabled={!plan} | ||
onClick={() => setIsCancelOpen(true)} | ||
className="btn btn-error flex-1 dark:text-white text-black" | ||
> | ||
Cancel Upgrade | ||
</button> | ||
</div> | ||
<UpgradeModal | ||
address={address} | ||
admin={admin} | ||
isOpen={isOpen} | ||
onClose={() => setIsOpen(false)} | ||
refetchPlan={refetchPlan} | ||
/> | ||
<CancelUpgradeModal | ||
plan={plan ?? ({} as PlanSDKType)} | ||
admin={admin} | ||
address={address} | ||
isOpen={isCancelOpen} | ||
onClose={() => setIsCancelOpen(false)} | ||
refetchPlan={refetchPlan} | ||
/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export * from './validatorList'; | ||
export * from './stakeHolderPayout'; | ||
export * from './chainUpgrader'; |
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,50 @@ | ||
import { MultiMintModal, MultiBurnModal } from '@/components/factory/modals'; | ||
import { MFX_TOKEN_DATA } from '@/utils/constants'; | ||
import { useState } from 'react'; | ||
|
||
interface StakeHolderPayoutProps { | ||
admin: string; | ||
address: string; | ||
} | ||
|
||
export const StakeHolderPayout = ({ admin, address }: StakeHolderPayoutProps) => { | ||
const [isOpenMint, setIsOpenMint] = useState(false); | ||
const [isOpenBurn, setIsOpenBurn] = useState(false); | ||
|
||
return ( | ||
<div className="w-full md:w-1/2 h-full bg-secondary rounded-lg p-6 flex flex-col gap-4 shadow-lg"> | ||
<div className="space-y-2"> | ||
<h1 className="text-xl font-bold text-secondary-content">Stake Holder Payout</h1> | ||
<p className="text-secondary-content/80 text-sm"> | ||
Burn MFX or mint MFX to pay out stake holders. | ||
</p> | ||
</div> | ||
|
||
<div className="flex flex-row w-full justify-between gap-4 mt-4"> | ||
<button onClick={() => setIsOpenMint(true)} className="btn btn-primary flex-1"> | ||
Mint MFX | ||
</button> | ||
<button | ||
onClick={() => setIsOpenBurn(true)} | ||
className="btn btn-error flex-1 dark:text-white text-black" | ||
> | ||
Burn MFX | ||
</button> | ||
</div> | ||
<MultiMintModal | ||
isOpen={isOpenMint} | ||
onClose={() => setIsOpenMint(false)} | ||
admin={admin} | ||
address={address} | ||
denom={MFX_TOKEN_DATA} | ||
/> | ||
<MultiBurnModal | ||
isOpen={isOpenBurn} | ||
onClose={() => setIsOpenBurn(false)} | ||
admin={admin} | ||
address={address} | ||
denom={MFX_TOKEN_DATA} | ||
/> | ||
</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
Oops, something went wrong.