File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const CheckoutForm = () => {
21
21
const [ cart , setCart ] = useContext ( AppContext ) ;
22
22
const [ orderData , setOrderData ] = useState ( null ) ;
23
23
const [ requestError , setRequestError ] = useState ( null ) ;
24
- const [ orderCompleted , setorderCompleted ] = useState ( false ) ;
24
+ const [ orderCompleted , setorderCompleted ] = useState ( false ) ;
25
25
26
26
// Checkout GraphQL mutation
27
27
const [
@@ -74,10 +74,15 @@ const CheckoutForm = () => {
74
74
{ /* Order*/ }
75
75
< OrderDetails cart = { cart } />
76
76
< MobileOrderDetails cart = { cart } />
77
-
78
77
{ /*Payment Details*/ }
79
78
< Billing onSubmit = { onSubmit } />
80
-
79
+ { /*Error display*/ }
80
+ { requestError && (
81
+ < div className = "h-32 text-xl text-center text-red-600" >
82
+ En feil har oppstått. Feilmeldingen er: < br /> $
83
+ { requestError . toString ( ) }
84
+ </ div >
85
+ ) }
81
86
{ /* Checkout Loading*/ }
82
87
{ checkoutLoading && (
83
88
< div className = "text-xl text-center" >
@@ -86,7 +91,6 @@ const CheckoutForm = () => {
86
91
< LoadingSpinner />
87
92
</ div >
88
93
) }
89
- { requestError }
90
94
</ div >
91
95
) : (
92
96
< >
You can’t perform that action at this time.
0 commit comments