-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup skeleton for deployer refund hook
Generalize slide-in animation and use for deploy steps Add TODOs on chain banners
- Loading branch information
Showing
9 changed files
with
133 additions
and
68 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
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,37 @@ | ||
import { AnimatePresence, motion } from 'framer-motion'; | ||
import { PropsWithChildren } from 'react'; | ||
|
||
export function SlideIn({ | ||
key, | ||
direction, | ||
children, | ||
}: PropsWithChildren<{ key: string | number; direction: 'forward' | 'backward' }>) { | ||
return ( | ||
<AnimatePresence mode="wait" custom={direction}> | ||
<motion.div | ||
key={key} | ||
custom={direction} | ||
variants={variants} | ||
transition={transition} | ||
initial="enter" | ||
animate="center" | ||
exit="exit" | ||
> | ||
{children} | ||
</motion.div> | ||
</AnimatePresence> | ||
); | ||
} | ||
|
||
const variants = { | ||
enter: (direction: 'forward' | 'backward') => ({ | ||
opacity: 0, | ||
x: direction === 'forward' ? 40 : -40, | ||
}), | ||
center: { opacity: 1, x: 0 }, | ||
exit: (direction: 'forward' | 'backward') => ({ | ||
opacity: 0, | ||
x: direction === 'forward' ? -40 : 40, | ||
}), | ||
}; | ||
const transition = { duration: 0.5 }; |
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,29 @@ | ||
import { sleep } from '@hyperlane-xyz/utils'; | ||
import { useMutation } from '@tanstack/react-query'; | ||
import { logger } from 'ethers'; | ||
import { useToastError } from '../../components/toast/useToastError'; | ||
import { useTempDeployerWallets } from './hooks'; | ||
import { TempDeployerWallets } from './types'; | ||
|
||
export function useRefundDeployerAccounts({ onSuccess }: { onSuccess?: () => void }) { | ||
const { wallets } = useTempDeployerWallets([]); | ||
|
||
const { error, mutate } = useMutation({ | ||
mutationKey: ['refundDeployerAccounts', wallets], | ||
mutationFn: () => refundDeployerAccounts(wallets), | ||
retry: 3, | ||
onSuccess, | ||
}); | ||
|
||
useToastError(error, 'Error refunding deployer balances. Please try again later.'); | ||
|
||
return mutate; | ||
} | ||
|
||
async function refundDeployerAccounts(_wallets: TempDeployerWallets) { | ||
//TODO | ||
logger.info('Refunding deployer accounts'); | ||
await sleep(10_000); | ||
logger.info('Done refunding deployer accounts'); | ||
return true; | ||
} |
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