diff --git a/public/backgrounds/planet-bg.png b/public/backgrounds/planet-bg.png new file mode 100644 index 0000000..7a7e405 Binary files /dev/null and b/public/backgrounds/planet-bg.png differ diff --git a/src/components/animation/PlanetSpinner.tsx b/src/components/animation/PlanetSpinner.tsx new file mode 100644 index 0000000..c0110f8 --- /dev/null +++ b/src/components/animation/PlanetSpinner.tsx @@ -0,0 +1,56 @@ +import { + motion, + useAnimation, + useAnimationFrame, + useMotionValue, + useTransform, +} from 'framer-motion'; +import Image from 'next/image'; +import { useEffect } from 'react'; +import Planet1 from '../../images/illustrations/planet1.png'; +import Planet2 from '../../images/illustrations/planet2.png'; + +export function PlanetSpinner() { + // Planet 1 animation: + // This rotates around the center of the div + const controls = useAnimation(); + useEffect(() => { + controls.start({ + rotate: 360, + transition: { + repeat: Infinity, + duration: 70, + ease: 'linear', + }, + }); + }, [controls]); + + // Planet 2 animation: + // These transform functions calculate the x and y position based on the angle + const angle = useMotionValue(0); + const x = useTransform(angle, (value) => 70 * Math.cos(value)); + const y = useTransform(angle, (value) => 70 * Math.sin(value)); + + useAnimationFrame((t) => { + angle.set(t / 5000); // Controls the speed of rotation + }); + + return ( +
+ + + + + + +
+ ); +} diff --git a/src/components/icons/LogsIcon.tsx b/src/components/icons/LogsIcon.tsx new file mode 100644 index 0000000..1e9bf66 --- /dev/null +++ b/src/components/icons/LogsIcon.tsx @@ -0,0 +1,17 @@ +import { DefaultIconProps } from '@hyperlane-xyz/widgets'; +import { memo } from 'react'; +import { Color } from '../../styles/Color'; + +// TODO move to widgets lib +function _LogsIcon({ color, ...rest }: DefaultIconProps) { + return ( + + + + ); +} + +export const LogsIcon = memo(_LogsIcon); diff --git a/src/features/deployment/warp/WarpDeploymentDeploy.tsx b/src/features/deployment/warp/WarpDeploymentDeploy.tsx index e3eda59..1f24dbb 100644 --- a/src/features/deployment/warp/WarpDeploymentDeploy.tsx +++ b/src/features/deployment/warp/WarpDeploymentDeploy.tsx @@ -1,20 +1,24 @@ -import { ArrowIcon, Button, WalletIcon } from '@hyperlane-xyz/widgets'; +import { ArrowIcon, Button, Modal, useModal, WalletIcon } from '@hyperlane-xyz/widgets'; import { useState } from 'react'; import { toast } from 'react-toastify'; +import { PlanetSpinner } from '../../../components/animation/PlanetSpinner'; import { SolidButton } from '../../../components/buttons/SolidButton'; import { GasIcon } from '../../../components/icons/GasIcon'; +import { LogsIcon } from '../../../components/icons/LogsIcon'; import { StopIcon } from '../../../components/icons/StopIcon'; import { H1 } from '../../../components/text/H1'; import { CardPage } from '../../../flows/CardPage'; import { useCardNav } from '../../../flows/hooks'; import { Color } from '../../../styles/Color'; +import { useMultiProvider } from '../../chains/hooks'; +import { getChainDisplayName } from '../../chains/utils'; import { useWarpDeploymentConfig } from '../hooks'; export function WarpDeploymentDeploy() { return ( -
+
- +
); @@ -24,15 +28,13 @@ function HeaderSection() { return

Deploying Warp Route

; } -function StatusSection() { +function MainSection() { const { deploymentConfig } = useWarpDeploymentConfig(); const _chains = deploymentConfig?.chains || []; - return ( -
- -
- ); + const [isDeploying, _setIsDeploying] = useState(true); + + return
{isDeploying ? : }
; } function FundAccounts() { @@ -51,7 +53,7 @@ function FundAccounts() { }; return ( -
+
@@ -70,12 +72,46 @@ function FundAccounts() { ); } +function DeployStatus() { + const multiProvider = useMultiProvider(); + const { deploymentConfig } = useWarpDeploymentConfig(); + const chains = deploymentConfig?.chains || []; + //TODO 'and' here + const chainListString = chains.map((c) => getChainDisplayName(multiProvider, c, true)).join(', '); + + const { isOpen, open, close } = useModal(); + const onClickViewLogs = () => { + // TODO get logs somehow + open(); + }; + + return ( +
+
+ +
+
+

{`Deploying to ${chainListString}`}

+

This will take a few minutes.

+

TODO status text

+
+ + +
TODO logs here
+
+
+ ); +} + function ButtonSection() { const { setPage } = useCardNav(); const onClickCancel = () => { // TODO cancel in SDK if possible? toast.warn('Deployment cancelled'); - setPage(CardPage.WarpReview); + setPage(CardPage.WarpForm); }; return ( diff --git a/src/images/illustrations/planet-bg.png b/src/images/illustrations/planet-bg.png new file mode 100644 index 0000000..7a7e405 Binary files /dev/null and b/src/images/illustrations/planet-bg.png differ diff --git a/src/images/illustrations/planet1.png b/src/images/illustrations/planet1.png new file mode 100644 index 0000000..1b1183c Binary files /dev/null and b/src/images/illustrations/planet1.png differ diff --git a/src/images/illustrations/planet2.png b/src/images/illustrations/planet2.png new file mode 100644 index 0000000..f9e1b0b Binary files /dev/null and b/src/images/illustrations/planet2.png differ