File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,10 +144,17 @@ const Checkout: React.FC<Props> = ({
144144 >
145145 < StepPayment tw = "mb-6" />
146146 </ AccordionItem >
147- < StepPlaceOrder
148- termsUrl = { termsUrl }
149- privacyUrl = { privacyUrl }
150- />
147+ < AccordionProvider
148+ activeStep = { activeStep }
149+ lastActivableStep = { lastActivableStep }
150+ setActiveStep = { setActiveStep }
151+ step = "Complete"
152+ >
153+ < StepPlaceOrder
154+ termsUrl = { termsUrl }
155+ privacyUrl = { privacyUrl }
156+ />
157+ </ AccordionProvider >
151158 </ PaymentContainer >
152159 </ AccordionProvider >
153160 </ Accordion >
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { useRouter } from "next/router"
44import { useContext , useState } from "react"
55import { Trans , useTranslation } from "react-i18next"
66
7+ import { AccordionContext } from "components/data/AccordionProvider"
78import { AppContext } from "components/data/AppProvider"
89import { GTMContext } from "components/data/GTMProvider"
910import { ButtonWrapper } from "components/ui/Button"
@@ -35,6 +36,7 @@ const StepPlaceOrder: React.FC<Props> = ({ termsUrl, privacyUrl }) => {
3536 const [ isPlacingOrder , setIsPlacingOrder ] = useState ( false )
3637
3738 const appCtx = useContext ( AppContext )
39+ const accordionCtx = useContext ( AccordionContext )
3840 const gtmCtx = useContext ( GTMContext )
3941
4042 if ( ! appCtx ) {
@@ -144,6 +146,7 @@ const StepPlaceOrder: React.FC<Props> = ({ termsUrl, privacyUrl }) => {
144146 < ButtonWrapper >
145147 < StyledPlaceOrderButton
146148 data-cy = "place-order-button"
149+ isActive = { accordionCtx ?. isActive }
147150 onClick = { handlePlaceOrder }
148151 label = {
149152 < >
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ import { ButtonCss } from "components/ui/Button"
1010import { CheckCss } from "components/ui/form/CheckBox"
1111import { ErrorCss } from "components/ui/form/Error"
1212
13+ interface StyledPlaceOrderButtonProps {
14+ isActive : boolean
15+ }
16+
1317export const ErrorWrapper = styled . div `
1418 ${ tw `bg-red-50 flex justify-center border border-2 border-red-300 ` }
1519 & + & {
@@ -32,9 +36,12 @@ export const ErrorsContainer = styled.div`
3236 ${ tw `mb-10` }
3337 }
3438`
35- export const StyledPlaceOrderButton = styled ( PlaceOrderButton ) `
39+ export const StyledPlaceOrderButton = styled < any & StyledPlaceOrderButtonProps > (
40+ PlaceOrderButton
41+ ) `
3642 ${ ButtonCss }
37- ${ tw `mx-5 mt-3.5 md:mx-0 md:mt-0` }
43+ ${ ( { isActive } ) => ( isActive ? null : tw `hidden` ) }
44+ ${ tw `mx-5 mt-3.5 md:mx-0 md:mt-0 active:hidden` }
3845`
3946export const StyledPrivacyAndTermsCheckbox = styled ( PrivacyAndTermsCheckbox ) `
4047 ${ CheckCss }
You can’t perform that action at this time.
0 commit comments