From f19b5e4c9f2f6fe65119f374793dba931e218c79 Mon Sep 17 00:00:00 2001 From: priyanshuvish Date: Thu, 10 Oct 2024 11:27:55 +0530 Subject: [PATCH] bugs fixed --- src/App.css | 130 ++++-- src/Components/Doughnut/BarCharts.jsx | 57 +++ src/Components/HeaderMain.jsx | 48 +- src/Components/PayCards/Platinium.jsx | 2 +- src/Components/PayCards/PlatiniumGift.jsx | 2 +- src/Contexts/GlobalStateProvider.jsx | 134 ++++-- src/Layout/DefaultLayout.jsx | 2 +- src/Pages/ContactUs/ContactUs.jsx | 10 +- src/Pages/Expenses/RequestReimbursement.jsx | 1 + src/Pages/Gifts/VouchersTab.jsx | 126 +++--- src/Pages/Home/Home.jsx | 457 ++++++++++++++------ src/Pages/Profile/Profile.jsx | 4 +- src/Pages/Report/Report.jsx | 101 +++-- src/Pages/Report/ReportsHistory.jsx | 204 ++++++++- src/Pages/Requests/AddReportModal.jsx | 2 +- src/Routes/Nav.js | 7 +- src/Routes/Routes.js | 2 + 17 files changed, 940 insertions(+), 349 deletions(-) create mode 100644 src/Components/Doughnut/BarCharts.jsx diff --git a/src/App.css b/src/App.css index 50d4934..da2e4e7 100644 --- a/src/App.css +++ b/src/App.css @@ -8,7 +8,7 @@ * { box-sizing: border-box; margin: 0; - padding: 0; + padding: 0; /* font-family: "League Spartan", sans-serif !important; */ /* font-family: "Poppins", sans-serif !important; */ /* font-family: "Lato", sans-serif !important; */ @@ -22,36 +22,52 @@ } .activee { - text-decoration: none; /* Remove underline */ - font-weight: bold; /* Optionally change font weight for active link */ - background: linear-gradient( - to right, - #7a45fb, - /* #764aaf67, */ - #de41b5 - ); /* Gradient background */ - -webkit-background-clip: text; /* Clip text to the background area */ - -webkit-text-fill-color: transparent; /* Fill text with the background color */ + text-decoration: none; + /* Remove underline */ + font-weight: bold; + /* Optionally change font weight for active link */ + background: linear-gradient(to right, + #7a45fb, + /* #764aaf67, */ + #de41b5); + /* Gradient background */ + -webkit-background-clip: text; + /* Clip text to the background area */ + -webkit-text-fill-color: transparent; + /* Fill text with the background color */ transition: all 0.3s ease-in-out; } .active { - /* background-color: #210A33; */ + /* background: linear-gradient(90deg, #5a47b2 50%, #6342ac 50%); + color: #fff; + font-weight: 600 !important; */ + background: linear-gradient(90deg, #5a47b2 50%, #6342ac 50%); + color: #fff; + font-weight: 600 !important; + border-radius: 4px; + padding-left: 4px; +} + +.custom-active { + background: transparent; color: #fff; - /* background-color: black; */ font-weight: 600 !important; } -a.single.active{ + +a.single.active { border-left: 2px solid #fff; background: linear-gradient(90deg, rgba(55, 37, 234, 0.6) 0%, rgba(94, 15, 205, 0.6) 100%); } + .chakra-accordion__item.css-1t7rcca:has(.active) { background: linear-gradient(90deg, rgba(55, 37, 234, 0.6) 0%, rgba(94, 15, 205, 0.6) 100%); border-left: 2px solid #fff; } -.chakra-accordion__item .link:hover{ + +/* .chakra-accordion__item .link:hover{ background:transparent !important; -} +} */ .link { text-decoration: none; transition: all 0.2s ease-in-out; @@ -81,9 +97,11 @@ a.single.active{ .web-text-small { font-size: 12px !important; } + .web-text-xxsmall { font-size: 9px !important; } + .web-text-xsmall { font-size: 11px !important; } @@ -117,15 +135,18 @@ a.single.active{ } .greeting { - text-decoration: none; /* Remove underline */ - font-weight: bold; /* Optionally change font weight for active link */ - background: linear-gradient( - to right, - #7a45fb, - #de41b5 - ); /* Gradient background */ - -webkit-background-clip: text; /* Clip text to the background area */ - -webkit-text-fill-color: transparent; /* Fill text with the background color */ + text-decoration: none; + /* Remove underline */ + font-weight: bold; + /* Optionally change font weight for active link */ + background: linear-gradient(to right, + #7a45fb, + #de41b5); + /* Gradient background */ + -webkit-background-clip: text; + /* Clip text to the background area */ + -webkit-text-fill-color: transparent; + /* Fill text with the background color */ transition: all 0.3s ease-in-out; } @@ -146,15 +167,14 @@ a.single.active{ color: #000; font-weight: 700; right: 110px; - background-image: radial-gradient( - circle, - #ffffff, - #eee2f2, - #e7c3dc, - #e5a3ba, - #de858e - ); + background-image: radial-gradient(circle, + #ffffff, + #eee2f2, + #e7c3dc, + #e5a3ba, + #de858e); } + .team-slider .swiper-button-prev:after { position: absolute; top: 185px; @@ -168,14 +188,12 @@ a.single.active{ color: #000; font-weight: 700; left: 110px; - background-image: radial-gradient( - circle, - #ffffff, - #eee2f2, - #e7c3dc, - #e5a3ba, - #de858e - ); + background-image: radial-gradient(circle, + #ffffff, + #eee2f2, + #e7c3dc, + #e5a3ba, + #de858e); } .text-animate { @@ -184,7 +202,7 @@ a.single.active{ animation-iteration-count: 1; } -.table-scroll::-webkit-scrollbar{ +.table-scroll::-webkit-scrollbar { width: 2px !important; height: 10px !important; } @@ -224,6 +242,7 @@ a.single.active{ right: 0; opacity: 0.1; } + .goog-te-banner-frame { display: none; } @@ -231,9 +250,11 @@ a.single.active{ .goog-te-banner-frame.skiptranslate { display: none !important; } + .goog-logo-link { display: none !important; } + .goog-te-gadget { color: transparent !important; } @@ -244,14 +265,17 @@ a.single.active{ color: #DE858E; /* margin-bottom: -40px; */ } + 30% { letter-spacing: 10px; /* margin-bottom: -40px; */ } + 85% { letter-spacing: 8px; /* margin-bottom: -40px; */ } + 100% { /* margin-bottom: 20px; */ } @@ -265,6 +289,7 @@ a.single.active{ 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } @@ -276,6 +301,7 @@ a.single.active{ width: 64px; height: 10px; } + .lds-ellipsis div { position: absolute; width: 10px; @@ -284,42 +310,52 @@ a.single.active{ background: #fff; animation-timing-function: cubic-bezier(0, 1, 1, 0); } + .lds-ellipsis div:nth-child(1) { left: 6px; animation: lds-ellipsis1 0.6s infinite; } + .lds-ellipsis div:nth-child(2) { left: 6px; animation: lds-ellipsis2 0.6s infinite; } + .lds-ellipsis div:nth-child(3) { left: 26px; animation: lds-ellipsis2 0.6s infinite; } + .lds-ellipsis div:nth-child(4) { left: 45px; animation: lds-ellipsis3 0.6s infinite; } + @keyframes lds-ellipsis1 { 0% { transform: scale(0); } + 100% { transform: scale(1); } } + @keyframes lds-ellipsis3 { 0% { transform: scale(1); } + 100% { transform: scale(0); } } + @keyframes lds-ellipsis2 { 0% { transform: translate(0, 0); } + 100% { transform: translate(19px, 0); } @@ -368,7 +404,7 @@ a.single.active{ -/* From Uiverse.io by Nawsome */ +/* From Uiverse.io by Nawsome */ .switch { display: block; background-color: black; @@ -384,20 +420,20 @@ a.single.active{ display: none; } -.switch input:checked + .button { +.switch input:checked+.button { transform: translateZ(20px) rotateX(25deg); box-shadow: 0 -10px 20px #ff1818; } -.switch input:checked + .button .light { +.switch input:checked+.button .light { animation: flicker 0.2s infinite 0.3s; } -.switch input:checked + .button .shine { +.switch input:checked+.button .shine { opacity: 1; } -.switch input:checked + .button .shadow { +.switch input:checked+.button .shadow { opacity: 0; } diff --git a/src/Components/Doughnut/BarCharts.jsx b/src/Components/Doughnut/BarCharts.jsx new file mode 100644 index 0000000..5000549 --- /dev/null +++ b/src/Components/Doughnut/BarCharts.jsx @@ -0,0 +1,57 @@ +import React from 'react'; +import { Bar } from 'react-chartjs-2'; +import { Chart as ChartJS, BarElement, CategoryScale, LinearScale, Tooltip, Legend } from 'chart.js'; + +// Register components in Chart.js +ChartJS.register(BarElement, CategoryScale, LinearScale, Tooltip, Legend); + +const BarChart = () => { + // Data for the bar chart + const data = { + labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'], + datasets: [ + { + label: 'Sales', + data: [10, 40, 20, 50, 25, 45, 30, 10, 30, 50, 25, 60], + backgroundColor: '#7f3ad8', + borderColor: 'rgba(75, 192, 192, 1)', + borderWidth: 1, + borderRadius: 8, + width:"10px", + }, + ], + }; + + // Options for the bar chart + const options = { + scales: { + x: { + barPercentage: 0.4, // Decrease this value to make bars narrower + categoryPercentage: 0.6, // Adjust this to control the space between categories + }, + y: { + beginAtZero: true, + ticks: { + // Add 'k' to the labels + callback: function (value) { + return value + 'k'; + }, + }, + }, + }, + plugins: { + tooltip: { + callbacks: { + // Customize the tooltip label + label: function (context) { + return context.raw + 'k'; + }, + }, + }, + }, + }; + + return ; +}; + +export default BarChart; diff --git a/src/Components/HeaderMain.jsx b/src/Components/HeaderMain.jsx index ff5f062..ef8b2d9 100644 --- a/src/Components/HeaderMain.jsx +++ b/src/Components/HeaderMain.jsx @@ -12,6 +12,7 @@ import { PopoverArrow, PopoverBody, PopoverContent, + PopoverFooter, PopoverTrigger, Portal, Text, @@ -26,28 +27,39 @@ import GlobalStateContext from "../Contexts/GlobalStateContext"; import mainLogo from "../assets/optifii_logo.svg"; import PrimaryButton from "./Buttons/PrimaryButton"; import Notifications from "../Pages/Notifications/Notifications"; +import { FaRegUser } from "react-icons/fa6"; +import { BiLogOut } from "react-icons/bi"; +import Cookies from "js-cookie"; // Import the Cookies library const HeaderMain = ({ - logOutHandler, slideDirecttion, isDrawerOpen, toggleDrawer, }) => { const navigate = useNavigate(); - const { image } = useContext(GlobalStateContext); + const { image, setIsAuthenticate } = useContext(GlobalStateContext); const [searchTerm, setSearchTerm] = useState(""); + + const logOutHandler = () => { + setIsAuthenticate(false); + Cookies.remove("isAuthenticated"); + localStorage.removeItem("refreshToken"); + localStorage.removeItem("accessToken"); + localStorage.removeItem("refreshTokenExp"); + navigate("/"); + }; + // For controlling the modal const { isOpen, onOpen, onClose } = useDisclosure(); return ( @@ -93,7 +105,7 @@ const HeaderMain = ({ - ({ borderBottom: isActive ? '1px solid #3725EA' : 'none', @@ -136,6 +148,27 @@ const HeaderMain = ({ navigate("/profile")} title={"View Profile"} /> + + + + + View as Admin + + + + + + Logout + + + @@ -164,4 +197,3 @@ const HeaderMain = ({ }; export default HeaderMain; - \ No newline at end of file diff --git a/src/Components/PayCards/Platinium.jsx b/src/Components/PayCards/Platinium.jsx index 766b4b9..0838a28 100644 --- a/src/Components/PayCards/Platinium.jsx +++ b/src/Components/PayCards/Platinium.jsx @@ -81,7 +81,7 @@ const Platinium = () => { - + diff --git a/src/Components/PayCards/PlatiniumGift.jsx b/src/Components/PayCards/PlatiniumGift.jsx index d9c35f7..3f40824 100644 --- a/src/Components/PayCards/PlatiniumGift.jsx +++ b/src/Components/PayCards/PlatiniumGift.jsx @@ -87,7 +87,7 @@ const PlatiniumGift = () => { - + diff --git a/src/Contexts/GlobalStateProvider.jsx b/src/Contexts/GlobalStateProvider.jsx index 4863003..c3fe807 100644 --- a/src/Contexts/GlobalStateProvider.jsx +++ b/src/Contexts/GlobalStateProvider.jsx @@ -51,7 +51,8 @@ const GlobalStateProvider = ({ children }) => { const [reportsHistory, setReportsHistory] = useState([ { "id": 1, - "name": "Office Supplies - July 2024", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "31-07-2024 10:15 am", "reportType": "Expense", "totalExpense": 350.75, @@ -59,7 +60,8 @@ const GlobalStateProvider = ({ children }) => { }, { "id": 2, - "name": "Travel Reimbursement - Q2 2024", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "15-08-2024 02:45 pm", "reportType": "Expense", "totalExpense": 1250.00, @@ -67,7 +69,8 @@ const GlobalStateProvider = ({ children }) => { }, { "id": 3, - "name": "Client Meeting Expenses - August 2024", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "28-08-2024 09:30 am", "reportType": "Expense", "totalExpense": 600.50, @@ -75,7 +78,8 @@ const GlobalStateProvider = ({ children }) => { }, { "id": 4, - "name": "Marketing Campaign - Q3 2024", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "10-09-2024 11:00 am", "reportType": "Expense", "totalExpense": 2300.00, @@ -83,136 +87,136 @@ const GlobalStateProvider = ({ children }) => { }, { "id": 5, - "name": "Team Building Event - September 2024", - "lastUpdated": "22-09-2024 04:20 pm", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "22-09-2024 04:20 pm", "reportType": "Expense", "totalExpense": 800.00, "status": "Fully Reimbursed" }, { "id": 6, - "name": "Office Renovation - Phase 1", - "lastUpdated": "30-09-2024 03:10 pm", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "30-09-2024 03:10 pm", "reportType": "Expense", "totalExpense": 4500.00, "status": "Saved" }, { "id": 7, - "name": "Software Licenses - 2024 Renewal", - "lastUpdated": "05-10-2024 01:50 pm", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "05-10-2024 01:50 pm", "reportType": "Expense", "totalExpense": 3200.00, "status": "Saved" }, { "id": 8, - "name": "Conference Attendance - October 2024", - "lastUpdated": "15-10-2024 09:00 am", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "15-10-2024 09:00 am", "reportType": "Expense", "totalExpense": 1500.00, "status": "Partially Reimbursed" }, { "id": 9, - "name": "Holiday Party - December 2024", - "lastUpdated": "20-12-2024 05:30 pm", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "20-12-2024 05:30 pm", "reportType": "Expense", "totalExpense": 2500.00, "status": "Saved" }, { "id": 10, - "name": "Client Gifts - End of Year 2024", - "lastUpdated": "31-12-2024 02:00 pm", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "31-12-2024 02:00 pm", "reportType": "Expense", "totalExpense": 1200.00, "status": "Approved" }, { "id": 11, - "name": "Training Programs - January 2025", - "lastUpdated": "15-01-2025 10:30 am", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "15-01-2025 10:30 am", "reportType": "Expense", "totalExpense": 900.00, "status": "Saved" }, { "id": 7, - "name": "Software Licenses - 2024 Renewal", - "lastUpdated": "05-10-2024 01:50 pm", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "05-10-2024 01:50 pm", "reportType": "Expense", "totalExpense": 3200.00, "status": "Saved" }, { "id": 8, - "name": "Conference Attendance - October 2024", - "lastUpdated": "15-10-2024 09:00 am", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "15-10-2024 09:00 am", "reportType": "Expense", "totalExpense": 1500.00, "status": "Partially Reimbursed" }, { "id": 9, - "name": "Holiday Party - December 2024", - "lastUpdated": "20-12-2024 05:30 pm", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "20-12-2024 05:30 pm", "reportType": "Expense", "totalExpense": 2500.00, "status": "Saved" }, { "id": 10, - "name": "Client Gifts - End of Year 2024", - "lastUpdated": "31-12-2024 02:00 pm", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "31-12-2024 02:00 pm", "reportType": "Expense", "totalExpense": 1200.00, "status": "Approved" }, { "id": 11, - "name": "Training Programs - January 2025", - "lastUpdated": "15-01-2025 10:30 am", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "15-01-2025 10:30 am", "reportType": "Expense", "totalExpense": 900.00, "status": "Saved" }, { "id": 7, - "name": "Software Licenses - 2024 Renewal", - "lastUpdated": "05-10-2024 01:50 pm", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "05-10-2024 01:50 pm", "reportType": "Expense", "totalExpense": 3200.00, "status": "Saved" }, { "id": 8, - "name": "Conference Attendance - October 2024", - "lastUpdated": "15-10-2024 09:00 am", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "15-10-2024 09:00 am", "reportType": "Expense", "totalExpense": 1500.00, "status": "Partially Reimbursed" }, { "id": 9, - "name": "Holiday Party - December 2024", - "lastUpdated": "20-12-2024 05:30 pm", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "20-12-2024 05:30 pm", "reportType": "Expense", "totalExpense": 2500.00, "status": "Saved" }, { "id": 10, - "name": "Client Gifts - End of Year 2024", - "lastUpdated": "31-12-2024 02:00 pm", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "31-12-2024 02:00 pm", "reportType": "Expense", "totalExpense": 1200.00, "status": "Approved" }, { "id": 11, - "name": "Training Programs - January 2025", - "lastUpdated": "15-01-2025 10:30 am", + "name": "Reimbursement", + "reportFor": "Report for June 2024", "lastUpdated": "15-01-2025 10:30 am", "reportType": "Expense", "totalExpense": 900.00, "status": "Saved" @@ -220,6 +224,55 @@ const GlobalStateProvider = ({ children }) => { ] ) + const [reportsHistoryMini, setReportsHistoryMini] = useState([ + { + "id": 1, + "name": "Reimbursement", + "reportFor": "Report for June 2024", + "lastUpdated": "31-07-2024 10:15 am", + "reportType": "Expense", + "totalExpense": 350.75, + "status": "Approved" + }, + { + "id": 2, + "name": "Reimbursement", + "reportFor": "Report for June 2024", + "lastUpdated": "31-07-2024 10:15 am", + "reportType": "Expense", + "totalExpense": 350.75, + "status": "Rejected" + }, + { + "id": 3, + "name": "Reimbursement", + "reportFor": "Report for June 2024", + "lastUpdated": "31-07-2024 10:15 am", + "reportType": "Expense", + "totalExpense": 350.75, + "status": "Approved" + }, + { + "id": 4, + "name": "Reimbursement", + "reportFor": "Report for June 2024", + "lastUpdated": "31-07-2024 10:15 am", + "reportType": "Expense", + "totalExpense": 350.75, + "status": "Rejected" + }, + { + "id": 5, + "name": "Reimbursement", + "reportFor": "Report for June 2024", + "lastUpdated": "31-07-2024 10:15 am", + "reportType": "Expense", + "totalExpense": 350.75, + "status": "Approved" + }, + ] + ) + const [requestsTable, setRequestTable] = useState([ @@ -384,8 +437,9 @@ const GlobalStateProvider = ({ children }) => { reportsHistory, setReportsHistory, requestsTable, - setRequestTable, image, setImage, - walletTable,setWalletTable, + setRequestTable, image, setImage, + walletTable, setWalletTable, + reportsHistoryMini, setReportsHistoryMini }} > {children} diff --git a/src/Layout/DefaultLayout.jsx b/src/Layout/DefaultLayout.jsx index 468f135..03c8018 100644 --- a/src/Layout/DefaultLayout.jsx +++ b/src/Layout/DefaultLayout.jsx @@ -442,7 +442,7 @@ const DashboardLayout = ({ isOnline }) => { } d-flex align-items-center p-0`} > { boxShadow={'sm'} p={8} > - - + { - - - + Get in touch + + + diff --git a/src/Pages/Expenses/RequestReimbursement.jsx b/src/Pages/Expenses/RequestReimbursement.jsx index bcf40aa..bd7fd78 100644 --- a/src/Pages/Expenses/RequestReimbursement.jsx +++ b/src/Pages/Expenses/RequestReimbursement.jsx @@ -284,6 +284,7 @@ const RequestReimbursement = () => { + diff --git a/src/Pages/Gifts/VouchersTab.jsx b/src/Pages/Gifts/VouchersTab.jsx index 9e909b7..956acf7 100644 --- a/src/Pages/Gifts/VouchersTab.jsx +++ b/src/Pages/Gifts/VouchersTab.jsx @@ -1,5 +1,5 @@ import { Button } from "@chakra-ui/button"; -import { Search2Icon } from "@chakra-ui/icons"; +import { ChevronDownIcon, Search2Icon } from "@chakra-ui/icons"; import { Input, InputGroup, InputLeftElement } from "@chakra-ui/input"; import { Box, HStack, VStack } from "@chakra-ui/layout"; import React, { useState } from "react"; @@ -12,6 +12,8 @@ import optifii_purple from '../../assets/optifii_purple.svg' import bewakoof from '../../assets/bewakoof.svg' import nyka from '../../assets/nyka.svg' import hAndm from '../../assets/h&m.svg' +import { Menu, MenuButton, MenuItem, MenuList } from "@chakra-ui/react"; +import { LuArrowDownWideNarrow, LuListFilter } from "react-icons/lu"; const VouchersTab = () => { const [activeTab, setActiveTab] = useState("My Voucher"); // Set default active tab @@ -19,88 +21,88 @@ const VouchersTab = () => { const brandData = [ { - brandLogo:gap, - brandColor:"#002A5F", - cardWorth:"10,000", - optifiiLogo:optifii_white, - patternColor:"" + brandLogo: gap, + brandColor: "#002A5F", + cardWorth: "10,000", + optifiiLogo: optifii_white, + patternColor: "" }, { - brandLogo:bewakoof, - brandColor:"#FFB819", - cardWorth:"10,000", - optifiiLogo:optifii_white, - patternColor:"" + brandLogo: bewakoof, + brandColor: "#FFB819", + cardWorth: "10,000", + optifiiLogo: optifii_white, + patternColor: "" }, { - brandLogo:nyka, - brandColor:"#FD2679", - cardWorth:"10,000", - optifiiLogo:optifii_white, - patternColor:"" + brandLogo: nyka, + brandColor: "#FD2679", + cardWorth: "10,000", + optifiiLogo: optifii_white, + patternColor: "" }, { - brandLogo:hAndm, - brandColor:"#ffffff", - cardWorth:"10,000", - optifiiLogo:optifii_purple, - patternColor:"" + brandLogo: hAndm, + brandColor: "#ffffff", + cardWorth: "10,000", + optifiiLogo: optifii_purple, + patternColor: "" }, { - brandLogo:hAndm, - brandColor:"#ffffff", - cardWorth:"10,000", - optifiiLogo:optifii_purple, - patternColor:"" + brandLogo: hAndm, + brandColor: "#ffffff", + cardWorth: "10,000", + optifiiLogo: optifii_purple, + patternColor: "" }, { - brandLogo:gap, - brandColor:"#002A5F", - cardWorth:"10,000", - optifiiLogo:optifii_white, - patternColor:"" + brandLogo: gap, + brandColor: "#002A5F", + cardWorth: "10,000", + optifiiLogo: optifii_white, + patternColor: "" }, { - brandLogo:bewakoof, - brandColor:"#FFB819", - cardWorth:"10,000", - optifiiLogo:optifii_white, - patternColor:"" + brandLogo: bewakoof, + brandColor: "#FFB819", + cardWorth: "10,000", + optifiiLogo: optifii_white, + patternColor: "" }, { - brandLogo:nyka, - brandColor:"#FD2679", - cardWorth:"10,000", - optifiiLogo:optifii_white, - patternColor:"" + brandLogo: nyka, + brandColor: "#FD2679", + cardWorth: "10,000", + optifiiLogo: optifii_white, + patternColor: "" }, { - brandLogo:nyka, - brandColor:"#FD2679", - cardWorth:"10,000", - optifiiLogo:optifii_white, - patternColor:"" + brandLogo: nyka, + brandColor: "#FD2679", + cardWorth: "10,000", + optifiiLogo: optifii_white, + patternColor: "" }, { - brandLogo:hAndm, - brandColor:"#ffffff", - cardWorth:"10,000", - optifiiLogo:optifii_purple, - patternColor:"" + brandLogo: hAndm, + brandColor: "#ffffff", + cardWorth: "10,000", + optifiiLogo: optifii_purple, + patternColor: "" }, { - brandLogo:gap, - brandColor:"#002A5F", - cardWorth:"10,000", - optifiiLogo:optifii_white, - patternColor:"" + brandLogo: gap, + brandColor: "#002A5F", + cardWorth: "10,000", + optifiiLogo: optifii_white, + patternColor: "" }, { - brandLogo:bewakoof, - brandColor:"#FFB819", - cardWorth:"10,000", - optifiiLogo:optifii_white, - patternColor:"" + brandLogo: bewakoof, + brandColor: "#FFB819", + cardWorth: "10,000", + optifiiLogo: optifii_white, + patternColor: "" }, ] @@ -165,6 +167,7 @@ const VouchersTab = () => { - - @@ -146,17 +150,34 @@ const Report = () => { Reports - + + + + + + + + setSearchTerm(e.target.value)} + /> + + + @@ -169,7 +190,7 @@ const Report = () => { /> - + ); }; diff --git a/src/Pages/Report/ReportsHistory.jsx b/src/Pages/Report/ReportsHistory.jsx index 38d604d..b026133 100644 --- a/src/Pages/Report/ReportsHistory.jsx +++ b/src/Pages/Report/ReportsHistory.jsx @@ -1,24 +1,202 @@ -import { Box, Input, Text, HStack, Button, Icon, Tag, Divider, flexbox, } from '@chakra-ui/react' -import React, { useContext } from 'react' -import MiniHeader from '../../Components/MiniHeader' -import { OPACITY_ON_LOAD } from '../../Layout/animations' -import { MdOutlineRamenDining } from "react-icons/md"; -import { RiDeleteBin5Line } from "react-icons/ri"; -import { FaRegFilePdf } from "react-icons/fa"; +import { + Box, + Button, + Divider, + HStack, + Icon, + Input, + InputGroup, + InputLeftElement, + Radio, + Tag, + TagLabel, + Text, + VStack, + useDisclosure, +} from "@chakra-ui/react"; +import React, { useContext, useEffect, useState } from "react"; +import MiniHeader from "../../Components/MiniHeader"; +import GlobalStateContext from "../../Contexts/GlobalStateContext"; +import NormalTable from "../../Components/DataTable/NormalTable"; +import { CalendarIcon, EmailIcon, SearchIcon, ViewIcon } from "@chakra-ui/icons"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; +import { MdNotificationsNone, MdOutlineHeadsetMic } from "react-icons/md"; +import { RiDeleteBin5Line, RiWallet3Line } from "react-icons/ri"; import { AiOutlineEdit } from "react-icons/ai"; -import GlobalStateContext from '../../Contexts/GlobalStateContext'; +import { FaRegEye } from "react-icons/fa"; +import { PiReceipt, PiScrollLight } from "react-icons/pi"; +import AddReportModal from "../Requests/AddReportModal"; +import PrimaryButton from "../../Components/Buttons/PrimaryButton"; const ReportsHistory = () => { + const { reportsHistory } = useContext(GlobalStateContext); + const [isLoading, setIsLoading] = useState(false); + const { isOpen, onOpen, onClose } = useDisclosure() + const [searchTerm, setSearchTerm] = useState(""); + + + useEffect(() => { + // Set isLoading to true + setIsLoading(true); + + // Simulate a 3-second delay + const timer = setTimeout(() => { + setIsLoading(false); // Set isLoading to false after 3 seconds + }, 500); + + // Cleanup the timer when the component unmounts or when the useEffect re-runs + return () => clearTimeout(timer); + }, []); // Empty dependency array means this effect runs once after the component mounts + + // ===============================[ Table Header ] + const tableHeadRow = [ + "Name", + "Last Update", + "Report type", + "Total Expense", + "Status", + "Actions", + ]; + + // const extractedArray = reportsHistory.map((item)=>({ })) + + const extractedArray = reportsHistory.map((item, index) => ({ + Name: + + + + + {item?.name} + + + {item?.reportFor} + + + + , + "Last Update": + item?.lastUpdated, + "Report type": item?.reportType, + "Total Expense": item?.totalExpense, + Status: ( + + {item?.status} + + ), + Actions: ( + + + + + + ), + })); + return ( - - ) -} + + + + Reports + + -export default ReportsHistory \ No newline at end of file + + + + + setSearchTerm(e.target.value)} + /> + + + + + + + + + + + + ); +}; + +export default ReportsHistory; diff --git a/src/Pages/Requests/AddReportModal.jsx b/src/Pages/Requests/AddReportModal.jsx index 5dfd93d..0ca1e79 100644 --- a/src/Pages/Requests/AddReportModal.jsx +++ b/src/Pages/Requests/AddReportModal.jsx @@ -15,7 +15,7 @@ const AddReportModal = ({isOpen, onClose}) => { Add Report - navigate('/reports/add-new-report')} leftIcon={} title={"Add To Report"}/> + navigate('/reports/add-new-report')} leftIcon={} title={"Add to New Report"}/> navigate('/reports')} leftIcon={} title={"Add To Existing Report"}/> diff --git a/src/Routes/Nav.js b/src/Routes/Nav.js index d471039..7d9dfae 100644 --- a/src/Routes/Nav.js +++ b/src/Routes/Nav.js @@ -1,13 +1,14 @@ import { HiOutlineNewspaper } from "react-icons/hi"; import { TbBrandMedium, TbSquareRoundedFilled } from "react-icons/tb"; import { + RiCustomerService2Fill, RiLogoutBoxLine, RiMoneyDollarBoxLine, } from "react-icons/ri"; import { RiExchangeBoxLine } from "react-icons/ri"; import { VscSymbolClass } from "react-icons/vsc"; import { FiHome, FiUsers } from "react-icons/fi"; -import {MdOutlineEditCalendar, MdOutlinePolicy, MdOutlineTaskAlt, MdWorkspacesOutline } from "react-icons/md"; +import {MdLogout, MdOutlineEditCalendar, MdOutlinePolicy, MdOutlineTaskAlt, MdWorkspacesOutline } from "react-icons/md"; import { GrNotification } from "react-icons/gr"; import HomeIcon from "../assets/homeIcon.png" import { PiReceiptBold } from "react-icons/pi"; @@ -61,13 +62,13 @@ export const nav = [ title: "Help & Support", type: "single", path: "/help-support", - Icon: MdOutlineLiveHelp, + Icon: RiCustomerService2Fill, }, { title: "Logout", type: "single", path: "/", - Icon: RiLogoutBoxLine, + Icon: MdLogout, }, ]; diff --git a/src/Routes/Routes.js b/src/Routes/Routes.js index a816233..4e466c0 100644 --- a/src/Routes/Routes.js +++ b/src/Routes/Routes.js @@ -16,6 +16,7 @@ import BuyVoucherCard from "../Pages/Gifts/SelectDenomination"; import ForWhom from "../Pages/Gifts/ForWhom"; import WelcomeToOptifiiComponent from "../Pages/Onboarding/WelcomeFrame"; import RequestReimbursement from "../Pages/Expenses/RequestReimbursement"; +import ReportsHistory from "../Pages/Report/ReportsHistory"; @@ -25,6 +26,7 @@ export const RouteLink = [ { path: "/home", Component: Home }, { path: "/expenses", Component: Expenses }, { path: "/reports", Component: Report }, + { path: "/reports/history", Component: ReportsHistory }, { path: "/reports/add-new-report", Component: AddNewReport }, // { path: "/reports/reports-history", Component: ReportsHistory }, { path: "/requests", Component: Requests },