File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,9 @@ import { useTranslate } from 'qwik-speak';
4
4
import { OrderSummary } from '~/components/OrderSummary/OrderSummary' ;
5
5
import { ShippingMethodSelector } from '~/components/ShippingMethodSelector/ShippingMethodSelector' ;
6
6
import { Divider } from '~/components/UI/Divider/Divider' ;
7
- import { ACTIONS_CONTEXT } from '~/shared/constants' ;
8
7
9
8
export default component$ ( ( ) => {
10
9
const t = useTranslate ( ) ;
11
- const actions = useContext ( ACTIONS_CONTEXT ) ;
12
10
return (
13
11
< main data-testid = 'checkout-layout' >
14
12
< div
@@ -199,9 +197,6 @@ export default component$(() => {
199
197
class = 'inline-flex items-center justify-center font-medium text-base focus-visible:outline focus-visible:outline-offset rounded-md disabled:text-disabled-500 disabled:bg-disabled-300 disabled:shadow-none disabled:ring-0 disabled:cursor-not-allowed py-3 leading-6 px-6 gap-3 text-white shadow hover:shadow-md active:shadow bg-primary-700 hover:bg-primary-800 active:bg-primary-900 disabled:bg-disabled-300 w-full mb-4 md:mb-0'
200
198
data-testid = 'button'
201
199
href = '/order/success'
202
- onClick$ = { ( ) => {
203
- actions . placeOrder ( ) ;
204
- } }
205
200
>
206
201
{ t ( 'placeOrder' ) }
207
202
</ a >
Original file line number Diff line number Diff line change 1
- import { component$ } from '@builder.io/qwik' ;
1
+ import { component$ , useContext , useVisibleTask$ } from '@builder.io/qwik' ;
2
2
import { Link } from '@builder.io/qwik-city' ;
3
3
import { Image } from 'qwik-image' ;
4
4
import { useTranslate } from 'qwik-speak' ;
5
5
import { SfButton } from 'qwik-storefront-ui' ;
6
+ import { ACTIONS_CONTEXT } from '~/shared/constants' ;
6
7
7
8
export default component$ ( ( ) => {
8
9
const t = useTranslate ( ) ;
10
+ const actions = useContext ( ACTIONS_CONTEXT ) ;
11
+ useVisibleTask$ ( ( ) => {
12
+ actions . placeOrder ( ) ;
13
+ } ) ;
9
14
return (
10
15
< div class = 'px-4 md:px-0' data-testid = 'order-success-page' >
11
16
< div class = 'border border-1 border-neutral-200 mt-10 mb-20 rounded p-4 md:p-6 flex flex-col items-center max-w-2xl mx-auto' >
You can’t perform that action at this time.
0 commit comments