diff --git a/frontend/package-lock.json b/frontend/package-lock.json index f17f9f3..961fc99 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -24,6 +24,7 @@ "jwt-decode": "^4.0.0", "prettier": "^3.1.0", "react": "^18.2.0", + "react-date-object": "^2.1.8", "react-dom": "^18.2.0", "react-router-dom": "^6.16.0", "typescript": "^5.2.2" @@ -4297,6 +4298,11 @@ "node": ">=0.10.0" } }, + "node_modules/react-date-object": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/react-date-object/-/react-date-object-2.1.8.tgz", + "integrity": "sha512-94zg/9r29v/VsKsJT0E5+tPg85IyMirkU/B7qBWlhT7RDSuf9x5dczfbQOsj9TbzSVUK/Vx/ZDboOBy9hA381w==" + }, "node_modules/react-dom": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", @@ -8014,6 +8020,11 @@ "loose-envify": "^1.1.0" } }, + "react-date-object": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/react-date-object/-/react-date-object-2.1.8.tgz", + "integrity": "sha512-94zg/9r29v/VsKsJT0E5+tPg85IyMirkU/B7qBWlhT7RDSuf9x5dczfbQOsj9TbzSVUK/Vx/ZDboOBy9hA381w==" + }, "react-dom": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", diff --git a/frontend/src/pages/my-account/MyAccount.jsx b/frontend/src/pages/my-account/MyAccount.jsx index 9bce866..0333679 100644 --- a/frontend/src/pages/my-account/MyAccount.jsx +++ b/frontend/src/pages/my-account/MyAccount.jsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Box, Button, Chip, CircularProgress, Divider, Stack, Tab, Tabs, Typography } from '@mui/material'; +import {Box, Button, Chip, CircularProgress, Divider, Stack, Tab, Tabs, TextField, Typography} from '@mui/material'; import ItemCard from '../../components/item-card/item-card.jsx'; import Toast from '../../components/toast/Toast.jsx'; import useMyAccount from './useMyAccount.js'; @@ -18,6 +18,8 @@ const MyAccount = () => { removeFromCartHandler, toastData, openToast, + offCode, + handleOffCodeInputHandler, setOpenToast, } = useMyAccount(); const [tabValue, setTabValue] = useState(TAB_ITEMS[2]); @@ -171,6 +173,16 @@ const MyAccount = () => { <> +
+ Have a Discount Code? + +
{renderTotalPrice()}