From e24de81b65321f20fad472a21222f8dfc79e4870 Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Wed, 6 Apr 2022 15:52:55 +0300 Subject: [PATCH] Adding connect wallet button to submit page --- src/components/Publish/Actions/index.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/Publish/Actions/index.tsx b/src/components/Publish/Actions/index.tsx index 85f739579..8ae9a0d40 100644 --- a/src/components/Publish/Actions/index.tsx +++ b/src/components/Publish/Actions/index.tsx @@ -5,6 +5,7 @@ import { FormikContextType, useFormikContext } from 'formik' import { FormPublishData } from '../_types' import { wizardSteps } from '../_constants' import SuccessConfetti from '@shared/SuccessConfetti' +import { useWeb3 } from '../../../@context/Web3' export default function Actions({ scrollToRef, @@ -21,6 +22,15 @@ export default function Actions({ setFieldValue }: FormikContextType = useFormikContext() + const { connect } = useWeb3() + + async function handleActivation(e: FormEvent) { + // prevent accidentially submitting a form the button might be in + e.preventDefault() + + await connect() + } + function handleNext(e: FormEvent) { e.preventDefault() setFieldValue('user.stepCurrent', values.user.stepCurrent + 1) @@ -65,6 +75,10 @@ export default function Actions({ > Continue + ) : values.user.accountId === '' || !isValid ? ( + ) : (