diff --git a/package.json b/package.json index 037023c..fc9c10e 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "clsx": "^2.1.1", "cosmjs-types": "^0.9.0", "formik": "^2.4.6", - "framer-motion": "^10.16.4", + "framer-motion": "^11.13.1", "next": "^15.0.3", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/src/components/buttons/BackButton.tsx b/src/components/buttons/BackButton.tsx new file mode 100644 index 0000000..329d1b1 --- /dev/null +++ b/src/components/buttons/BackButton.tsx @@ -0,0 +1,16 @@ +import { ArrowIcon, Button } from '@hyperlane-xyz/widgets'; +import { ComponentProps } from 'react'; +import { CardPage } from '../../flows/CardPage'; +import { useCardNav } from '../../flows/hooks'; +import { Color } from '../../styles/Color'; + +export function BackButton({ page, ...rest }: ComponentProps & { page: CardPage }) { + const { setPage } = useCardNav(); + + return ( + + ); +} diff --git a/src/components/buttons/ConnectAwareSubmitButton.tsx b/src/components/buttons/ConnectAwareSubmitButton.tsx index 57679d7..91e039f 100644 --- a/src/components/buttons/ConnectAwareSubmitButton.tsx +++ b/src/components/buttons/ConnectAwareSubmitButton.tsx @@ -40,7 +40,7 @@ export function ConnectAwareSubmitButton({ chainName, text, cl useTimeout(clearErrors, 3500); return ( - + {content} ); diff --git a/src/components/buttons/SolidButton.tsx b/src/components/buttons/SolidButton.tsx index 4073460..5720bec 100644 --- a/src/components/buttons/SolidButton.tsx +++ b/src/components/buttons/SolidButton.tsx @@ -1,10 +1,11 @@ +import clsx from 'clsx'; import { PropsWithChildren, ReactElement } from 'react'; interface ButtonProps { type?: 'submit' | 'reset' | 'button'; color?: 'white' | 'primary' | 'accent' | 'green' | 'red' | 'gray'; // defaults to primary bold?: boolean; - classes?: string; + className?: string; icon?: ReactElement; } @@ -15,7 +16,7 @@ export function SolidButton( type, onClick, color: _color, - classes, + className, bold, icon, disabled, @@ -48,7 +49,7 @@ export function SolidButton( } const onDisabled = 'disabled:bg-gray-300 disabled:text-gray-500'; const weight = bold ? 'font-semibold' : ''; - const allClasses = `${base} ${baseColors} ${onHover} ${onDisabled} ${weight} ${classes}`; + const allClasses = clsx(base, baseColors, onHover, onDisabled, weight, className); return (