MCPcopy Index your code
hub / github.com/Source-Controller/eCommerce-Fullstack / successPay

Function successPay

pages/successPay.js:8–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6import { runConfetti } from '../lib/utils';
7
8const successPay = () => {
9 const { setCartItems, setTotalPrice, setTotalQty } = useStateContext();
10
11 useEffect(() => {
12 localStorage.clear();
13 setCartItems([]);
14 setTotalPrice(0);
15 setTotalQty(0);
16 runConfetti();
17 }, []);
18
19 return (
20 <div className='success'>
21 <p className='icon'>
22 <BsBagCheckFill size={80} />
23 </p>
24 <h1>Thank you for your order!</h1>
25 <p>Check your email inbox for the receipt</p>
26 <p className='description'>
27 If you have any questions, please email
28 <a href="mailto:dinemarket@example.com">
29 dinemarket@example.com
30 </a>
31 </p>
32 <Link href="/">
33 <button className='btn' type="button" width="300px">
34 Continue Shopping
35 </button>
36 </Link>
37 </div>
38 )
39}
40
41export default successPay

Callers

nothing calls this directly

Calls 2

useStateContextFunction · 0.90
runConfettiFunction · 0.90

Tested by

no test coverage detected