Skip to content

Commit

Permalink
completed
Browse files Browse the repository at this point in the history
  • Loading branch information
vimalraj3 committed Aug 13, 2023
1 parent 9355fda commit 23655c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions client/src/Components/Cart/Address/AddressSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ import {
useEditUserAddress,
} from "../../../hooks";
import { Grid, Skeleton } from "@mui/material";
import { useCheckout } from "../../../hooks/useCheckout";
import { setAddressId } from "../../../state/slices/checkout.slice";
import { AddAddress } from "../../account/Sections/Address/AddAddress";
import { Address } from "../../account/Sections/Address/Address";
import { setDialogBoxOpen } from "../../../state/slices/dialog.slice";

export const AddressSelector = () => {
const [dialogBoxOpen, setDialogBoxOpen] = useState(false);
const { address } = useAppSelector((state) => state.addressState);

const [handleSubmit] = useEditUserAddress();
Expand All @@ -30,7 +29,7 @@ export const AddressSelector = () => {
} else {
handleSubmit(data, true);
}
setDialogBoxOpen(false);
dispatch(setDialogBoxOpen(false));
};

return (
Expand Down
2 changes: 0 additions & 2 deletions client/src/Components/Cart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { fetchCartByUserId } from "../../state/slices/cart.slice";
const index: React.FC = () => {
const dispatch = useAppDispatch();

const { cart } = useAppSelector((state) => state.cartState);

const email = useAppSelector((state) => state.userState.data.email);

useEffect(() => {
Expand Down
6 changes: 4 additions & 2 deletions client/src/Components/home/OfferCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ function OfferCard() {
const dispatch = useAppDispatch();
const scrollTo = useScroll();
const handleSearch = (searchFor: string) => {
dispatch(getAllFoods());
scrollTo("foods");
dispatch(setSearch(searchFor));
scrollTo("foods");
setTimeout(() => {
dispatch(getAllFoods());
}, 200);
};
return (
<section className="mx-auto mt-5 flex w-[90%] max-w-[1200px] flex-col items-center justify-evenly md:mt-10 md:flex-row">
Expand Down

1 comment on commit 23655c8

@vercel
Copy link

@vercel vercel bot commented on 23655c8 Aug 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.