Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking bugs #9

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
7121f64
debugging the function to open and clode the cart
Aug 3, 2024
f59efc3
debugging react-router in Slide.jsx
Aug 3, 2024
c4ffce1
correcting the import statement in Cart.jsx.
Aug 3, 2024
b9e46e2
fixing the typo error- reduce instead of drop in Cart.jsx.
Aug 3, 2024
442a2e9
Updated to use updateCurrentUser
Aug 3, 2024
7f5572f
DefiningLightPurpleButton locally
Aug 3, 2024
7c1df52
eliminating the double defination of LightPurpleButton in Cart.jsx
Aug 3, 2024
2a12970
Import Button from @mui/material in styles.js file
Aug 3, 2024
5a285e8
Defining and exporting BasicButton in styles.js file
Aug 3, 2024
54e1a1e
Defining and exporting LightPurpleButton
Aug 3, 2024
14f450c
removing the locally defined LightPurpleButton in Cart.jsx file
Aug 3, 2024
abc9ea6
replacing "=" with "=" for "reducer" in store.js file
Aug 3, 2024
5af6a14
defining the missinig try block in userHandle.js fille
Aug 3, 2024
627a678
exportnig the getCustomersListFailed from the userSlice.js file
Aug 3, 2024
8e2c16d
exporting the setFilteredProducts from the userSlice.js file
Aug 3, 2024
6e43473
recorrecting the import file path as userSlice instead usedHandle in …
Aug 3, 2024
dbcfd60
defining the taskHandler() function into the AlertDialogSlide.jsx file
Aug 3, 2024
1f5bfb3
Adding the useNevigate hook to define 'nevigate' into the Products.js…
Aug 3, 2024
0859786
Corrected useSelector to select from the state
Aug 3, 2024
1eec052
Fixed the calculation for indexOfFirstItem
Aug 3, 2024
ddc047b
Updated to use productData for currentItems
Aug 3, 2024
22ea97d
Added check for empty productData
Aug 3, 2024
fe20d54
updating the text error to productData
Aug 3, 2024
025eab7
Added SpeedDialAction import into the SpeedDIalTempalate file.
Aug 3, 2024
275f110
Added tableCellClasses import into the table template file.
Aug 3, 2024
f349bd0
Fixed slicing logic
Aug 3, 2024
512c715
Fixed tabIndex value
Aug 3, 2024
a13761b
Fixed key and column.id
Aug 3, 2024
40f93a0
Fixed format function call
Aug 3, 2024
777fecb
corrected typo error as anchor instead ancor
Aug 3, 2024
b241d90
recorrected totalprice as totalOGPrice
Aug 3, 2024
c3657f1
Fixed typo missing point separator
Aug 3, 2024
534a600
debuggnig to Check if responseSpecificProducts is empty and handle r…
Aug 3, 2024
e2bbc9c
Styled component SearchContainer as a form element
Aug 3, 2024
606f6ca
Updated handleSearch to use event parameter and call preventDefault
Aug 3, 2024
3d227af
recorrecting the typo error as review.reviewer.name
Aug 3, 2024
2a001a6
Changed useEffect to useState
Aug 3, 2024
0711204
Added default value for type prop
Aug 3, 2024
b056bd2
Used the useLocation hook to get the current path
Aug 3, 2024
0b33bc6
Import Box and Grid from MUI
Aug 3, 2024
a0c8945
Fixed button text
Aug 3, 2024
a2be7e5
Fixed dialog message
Aug 3, 2024
5031d5c
fixed typo as review.reviewerName
Aug 3, 2024
7806fc1
Fixed the undefined 'reviewDate' issue
Aug 3, 2024
18e1463
adding address parameter to getCustomers function
Aug 3, 2024
241d2a7
Use MUI Button as a placeholder
Aug 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
239 changes: 236 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/components/AlertDialogSlide.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const AlertDialogSlide = ({ dialog, showDialog, setShowDialog }) => {
const handleClose = () => {
setShowDialog(false);
};
const taskHandler = () => { // defining the taskHandler function;
setShowDialog(false);
};
return (
<Dialog
open={showDialog}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Popup.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { useDispatch } from 'react-redux';
import { underControl } from '../redux/userHandle';
import { underControl } from '../redux/userSlice'; // recorrecting the file path as userSlice instead userHandle
import MuiAlert from '@mui/material/Alert';
import { Snackbar } from '@mui/material';

Expand Down
9 changes: 5 additions & 4 deletions src/components/Products.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ import { addStuff } from '../redux/userHandle';

const Products = ({}) => {
const dispatch = useDispatch();
const navigate = useNavigate(); // **Added the useNavigate hook to define `navigate`**

const itemsPerPage = 9;

const { currentRole, responseSearch } = useSelector();
const { currentRole, productData } = useSelector((state) => state.user); // **Corrected useSelector to select from the state**
const [currentPage, setCurrentPage] = useState(1);
const [showPopup, setShowPopup] = useState(false);
const [message, setMessage] = useState("");

const indexOfLastItem = currentPage * itemsPerPage;
const indexOfFirstItem = indexOfLastItem + itemsPerPage;
const currentItems = (indexOfFirstItem, indexOfLastItem);
const indexOfFirstItem = indexOfLastItem - itemsPerPage; // **Fixed the calculation for indexOfFirstItem**
const currentItems = productData.slice(indexOfFirstItem, indexOfLastItem); // **Updated to use productData for currentItems**

const handleAddToCart = (event, product) => {
event.stopPropagation();
Expand All @@ -39,7 +40,7 @@ const Products = ({}) => {
setShowPopup(true)
};

if (!responseSearch) {
if (!productData || productData.length === 0) { // **Added check for empty productData**
return <div>Product not found</div>;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/SpeedDialTemplate.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { SpeedDial, styled } from '@mui/material';
import { SpeedDial, SpeedDialAction, styled } from '@mui/material'; // **Added SpeedDialAction import**
import TuneIcon from '@mui/icons-material/Tune';

const SpeedDialTemplate = ({ actions }) => {
Expand Down
Loading