Skip to content

Commit

Permalink
Merge pull request #71 from jeevan-aj/update
Browse files Browse the repository at this point in the history
remove some errors suggested by react
  • Loading branch information
jeevan-aj authored May 31, 2024
2 parents de25cf1 + 0411d3c commit 8e8841d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
16 changes: 10 additions & 6 deletions client/src/components/UserProfileContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ import { useDispatch, useSelector } from "react-redux";
import ProfileEdit from "../pages/user/ProfileEdit";
import toast, { Toaster } from "react-hot-toast";
import { setUpdated } from "../redux/user/userSlice";
import { useEffect } from "react";

const UserProfileContent = () => {
const { email, username, profilePicture, phoneNumber, adress } = useSelector(
(state) => state.user.currentUser
);
const dispatch = useDispatch();
const isUpdated = useSelector((state) => state.user.isUpdated);
if (isUpdated) {
toast.success("successfully updated");
dispatch(setUpdated(false));
}

useEffect(() => {
if (isUpdated) {
toast.success("Successfully updated");
dispatch(setUpdated(false));
}
}, [isUpdated, dispatch]);

return (
<div className="px-4 mx-auto mt-12 bg-white w-full sm:px-6 lg:px-8">
Expand All @@ -27,9 +31,9 @@ const UserProfileContent = () => {
className="w-full h-full rounded-full object-center object-cover"
/>
<div className="absolute bottom-0 left-[60px] z-10 ">
<button type="button" className=" p-3">
<div type="button" className=" p-3">
<ProfileEdit />
</button>
</div>
</div>
</div>
<div className="">
Expand Down
4 changes: 1 addition & 3 deletions client/src/pages/admin/components/BookingsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { DataGrid } from "@mui/x-data-grid";
import Box from "@mui/material/Box";

const BookingsTable = () => {
const [bookings, setBookings] = useState("");
const [bookings, setBookings] = useState([]);

const fetchBookings = async () => {
try {
Expand Down Expand Up @@ -126,8 +126,6 @@ const BookingsTable = () => {

//rows
const rows =
bookings &&
bookings.length > 0 &&
bookings.map((cur) => ({
id: cur._id,
bookingId: cur._id,
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/user/Orders.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export default function Orders() {
<div className="max-w-4xl mx-auto py-20">
<UserOrderDetailsModal />
<h1 className="text-4xl font-semibold mb-2">Your Bookings</h1>
<p className="text-sm text-gray-600 mb-8">
<div className="text-sm text-gray-600 mb-8">
{bookings && bookings.length > 0 ? "Check out all of your Bookings" : <div className="font-extrabold text-black flex justify-center items-center min-h-[500px]">No Bookings Yet</div>}
</p>
</div>
<div className="mb-8">
{bookings && bookings.length > 0
&& bookings.map((cur, idx) => {
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/vendor/Components/VendorBookingTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ const VendorBookingsTable = () => {
<div className="max-w-4xl mx-auto pb-20">
<VendorBookingDetailModal />

<p className="text-sm text-gray-600 mb-8">
<div className="text-sm text-gray-600 mb-8">
{filtered && filtered.length > 0 ? (
"Check out all of your Bookings"
) : (
<div className="font-extrabold text-black flex justify-center items-center min-h-[500px]">
No Bookings Yet
</div>
)}
</p>
</div>
<div className="mb-8">
{filtered &&
filtered.length > 0 &&
Expand Down

0 comments on commit 8e8841d

Please sign in to comment.