forked from adrianhajdin/ecommerce_sanity_stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
success.js
43 lines (38 loc) · 1.15 KB
/
success.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React, { useState, useEffect } from 'react';
import Link from 'next/link';
import { BsBagCheckFill } from 'react-icons/bs';
import { useStateContext } from '../context/StateContext';
import { runFireworks } from '../lib/utils';
const Success = () => {
const { setCartItems, setTotalPrice, setTotalQuantities } = useStateContext();
useEffect(() => {
localStorage.clear();
setCartItems([]);
setTotalPrice(0);
setTotalQuantities(0);
runFireworks();
}, []);
return (
<div className="success-wrapper">
<div className="success">
<p className="icon">
<BsBagCheckFill />
</p>
<h2>Thank you for your order!</h2>
<p className="email-msg">Check your email inbox for the receipt.</p>
<p className="description">
If you have any questions, please email
</a>
</p>
<Link href="/">
<button type="button" width="300px" className="btn">
Continue Shopping
</button>
</Link>
</div>
</div>
)
}
export default Success