From 5dca00683253a938fcae4d770fd0fc2b2099e839 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 26 Nov 2021 11:03:55 +0000 Subject: [PATCH] page title tweaks --- src/components/Publish/Actions/index.tsx | 18 ++++----- src/components/Publish/Title/index.tsx | 9 +++-- src/components/Publish/index.tsx | 48 ++++++++++++------------ 3 files changed, 37 insertions(+), 38 deletions(-) diff --git a/src/components/Publish/Actions/index.tsx b/src/components/Publish/Actions/index.tsx index b00dcf1a6..b310ae44f 100644 --- a/src/components/Publish/Actions/index.tsx +++ b/src/components/Publish/Actions/index.tsx @@ -1,23 +1,17 @@ -import React, { FormEvent, ReactElement, Ref, RefObject } from 'react' +import React, { FormEvent, ReactElement, RefObject } from 'react' import Button from '@shared/atoms/Button' import styles from './index.module.css' import { FormikContextType, useFormikContext } from 'formik' import { FormPublishData } from '../_types' import { wizardSteps } from '../_constants' -import { useWeb3 } from '@context/Web3' export default function Actions({ scrollToRef }: { scrollToRef: RefObject }): ReactElement { - const { accountId } = useWeb3() - const { - status, - values, - isValid, - setFieldValue - }: FormikContextType = useFormikContext() + const { values, isValid, setFieldValue }: FormikContextType = + useFormikContext() function handleNext(e: FormEvent) { e.preventDefault() @@ -42,7 +36,11 @@ export default function Actions({ Continue ) : ( - )} diff --git a/src/components/Publish/Title/index.tsx b/src/components/Publish/Title/index.tsx index 4bbb51341..00a6667af 100644 --- a/src/components/Publish/Title/index.tsx +++ b/src/components/Publish/Title/index.tsx @@ -1,13 +1,14 @@ import React, { ReactElement } from 'react' import NetworkName from '@shared/NetworkName' import Tooltip from '@shared/atoms/Tooltip' -import { useWeb3 } from '@context/Web3' import styles from './index.module.css' import content from '../../../../content/publish/index.json' -export default function Title(): ReactElement { - const { networkId } = useWeb3() - +export default function Title({ + networkId +}: { + networkId: number +}): ReactElement { return ( <> {content.title}{' '} diff --git a/src/components/Publish/index.tsx b/src/components/Publish/index.tsx index e6c782a1d..87504c7af 100644 --- a/src/components/Publish/index.tsx +++ b/src/components/Publish/index.tsx @@ -1,5 +1,5 @@ import React, { ReactElement, useState, useRef } from 'react' -import { Form, Formik } from 'formik' +import { Form, Formik, validateYupSchema } from 'formik' import { initialValues } from './_constants' import { validationSchema } from './_validation' import { useAccountPurgatory } from '@hooks/useAccountPurgatory' @@ -80,29 +80,29 @@ export default function PublishPage({ } } - return ( - <> - } description={content.description} /> - - {isInPurgatory && purgatoryData ? null : ( - { - // kick off publishing - await handleSubmit(values) - }} - > - <> -
- - - - - {debug && } - -
+ return isInPurgatory && purgatoryData ? null : ( + { + // kick off publishing + await handleSubmit(values) + }} + > + {({ values }) => ( + <> + } + description={content.description} + /> +
+ + + + + {debug && } + )} - +
) }