()
| 6 | import { runConfetti } from '../lib/utils'; |
| 7 | |
| 8 | const 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 | |
| 41 | export default successPay |
nothing calls this directly
no test coverage detected