diff --git a/src/components/Publish/Actions/index.module.css b/src/components/Publish/Actions/index.module.css index 2304f7f58..f4b6e8d0b 100644 --- a/src/components/Publish/Actions/index.module.css +++ b/src/components/Publish/Actions/index.module.css @@ -1,7 +1,11 @@ .actions { display: flex; - justify-content: space-between; + justify-content: center; align-items: center; padding-top: var(--spacer); border-top: 1px solid var(--border-color); } + +.actions button { + margin: 0 calc(var(--spacer) / 2); +} diff --git a/src/components/Publish/Actions/index.tsx b/src/components/Publish/Actions/index.tsx index 404c3f231..c3404ee43 100644 --- a/src/components/Publish/Actions/index.tsx +++ b/src/components/Publish/Actions/index.tsx @@ -1,4 +1,4 @@ -import React, { FormEvent, ReactElement } from 'react' +import React, { FormEvent, ReactElement, Ref, RefObject } from 'react' import { useOcean } from '@context/Ocean' import Button from '@shared/atoms/Button' import styles from './index.module.css' @@ -6,7 +6,11 @@ import { FormikContextType, useFormikContext } from 'formik' import { FormPublishData } from '../_types' import { wizardSteps } from '../_constants' -export default function Actions(): ReactElement { +export default function Actions({ + scrollToRef +}: { + scrollToRef: RefObject +}): ReactElement { const { ocean, account } = useOcean() const { status, @@ -18,16 +22,18 @@ export default function Actions(): ReactElement { function handleNext(e: FormEvent) { e.preventDefault() setFieldValue('step', values.step + 1) + scrollToRef.current.scrollIntoView() } function handlePrevious(e: FormEvent) { e.preventDefault() setFieldValue('step', values.step - 1) + scrollToRef.current.scrollIntoView() } return (