-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15a4a0c
commit 772f73f
Showing
12 changed files
with
297 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[ | ||
{ | ||
"price": 200, | ||
"badge": "Platinum", | ||
"badgeImg": "https://i.ibb.co/C27Wgv4/download-2.jpg" | ||
}, | ||
{ | ||
"price": 300, | ||
"badge": "gold", | ||
"badgeImg": "https://i.ibb.co/MC3VxDp/download-4.jpg" | ||
}, | ||
{ | ||
"price": 150, | ||
"badge": "silver", | ||
"badgeImg": "https://i.ibb.co/nLqwdg1/download-3.jpg" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { useQuery } from "@tanstack/react-query"; | ||
// import useAxiosCommon from "../../Hooks/useAxiosCommon"; | ||
import useAxiosSecqur from "../../Hooks/useAxiosSecqur"; | ||
import LogingSpiner from "../../Sheare/LogingSpiner"; | ||
|
||
const ServicMeal = () => { | ||
const axiosSec = useAxiosSecqur(); | ||
const { | ||
data: requst = [], | ||
isLoading, | ||
refetch, | ||
} = useQuery({ | ||
queryKey: ["requst"], | ||
queryFn: async () => { | ||
const { data } = await axiosSec.get("/allrequstmeal"); | ||
return data; | ||
}, | ||
}); | ||
|
||
if (isLoading) return <LogingSpiner></LogingSpiner>; | ||
return ( | ||
<div className="my-10"> | ||
<h2 className="text-3xl font-bold">All Requst meal</h2> | ||
<div className="overflow-x-auto"> | ||
<table className="table"> | ||
{/* head */} | ||
<thead> | ||
<tr> | ||
<th>#</th> | ||
<th>Title</th> | ||
<th>Email</th> | ||
<th>Name</th> | ||
<th>status</th> | ||
<th>serve</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{requst.map((req, inx) => ( | ||
<tr key={req._id}> | ||
<th>{inx + 1}</th> | ||
<td>Cy Ganderton</td> | ||
<td>Quality Control Specialist</td> | ||
<td>Blue</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ServicMeal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const Payment = () => { | ||
return ( | ||
<div> | ||
<h1 className="text3xl md:text-5xl font-bold"> Payment</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Payment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { async } from "@firebase/util"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import toast from "react-hot-toast"; | ||
import Swal from "sweetalert2"; | ||
import useAuth from "../Hooks/useAuth"; | ||
// import useAxiosCommon from "../Hooks/useAxiosCommon"; | ||
import useAxiosSecqur from "../Hooks/useAxiosSecqur"; | ||
import LogingSpiner from "../Sheare/LogingSpiner"; | ||
|
||
const UserRequstmeal = () => { | ||
const { user } = useAuth(); | ||
// const axioscom = useAxiosCommon(); | ||
const axiosSec = useAxiosSecqur(); | ||
const { | ||
data: requst = [], | ||
isLoading, | ||
refetch, | ||
} = useQuery({ | ||
queryKey: ["requst", user?.email], | ||
queryFn: async () => { | ||
const { data } = await axiosSec.get(`/requstmeal?email=${user.email}`); | ||
return data; | ||
}, | ||
}); | ||
const handelCansel = async (id) => { | ||
Swal.fire({ | ||
title: "Are you sure?", | ||
text: "you punlish thid item", | ||
icon: "warning", | ||
showCancelButton: true, | ||
confirmButtonColor: "#3085d6", | ||
cancelButtonColor: "#d33", | ||
confirmButtonText: "Yes, Publish!", | ||
}).then(async (result) => { | ||
if (result.isConfirmed) { | ||
const res = await axioscom.delete(`/requstmeal/${id}`); | ||
if (res.data.deletedCount > 0) { | ||
toast.success("cancel sucessifully"); | ||
} | ||
} | ||
refetch(); | ||
}); | ||
}; | ||
if (isLoading) return <LogingSpiner></LogingSpiner>; | ||
return ( | ||
<div> | ||
<h2 className="text-3xl font-bold"> Requsted meals</h2> | ||
|
||
<div className="overflow-x-auto"> | ||
<table className="table"> | ||
{/* head */} | ||
<thead> | ||
<tr> | ||
<th>#</th> | ||
<th>Title</th> | ||
<th>Likes</th> | ||
<th>Reviews</th> | ||
<th>Status</th> | ||
<th>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{requst.map((req, inx) => ( | ||
<tr key={req._id}> | ||
<th>{inx + 1}</th> | ||
<td>{req?.title} </td> | ||
<td>{req?.likes}</td> | ||
<td>reviews</td> | ||
<td> | ||
<p | ||
className={` p-1 rounded-lg text-center ${ | ||
req.status === " pending" && " bg-red-600 text-white" | ||
} ${ | ||
req.status === "delivered" && " bg-green-600 text-white" | ||
}`} | ||
> | ||
{req?.status} | ||
</p>{" "} | ||
</td> | ||
<td> | ||
<button | ||
onClick={() => handelCansel(req._id)} | ||
className=" btn " | ||
> | ||
<span className=" text-red">x</span> cancel{" "} | ||
</button> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default UserRequstmeal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { Link } from "react-router-dom"; | ||
import useAxiosCommon from "../../Hooks/useAxiosCommon"; | ||
import LogingSpiner from "../../Sheare/LogingSpiner"; | ||
|
||
const PrimeMeal = () => { | ||
const axioscom = useAxiosCommon(); | ||
const { data: badge = [], isLoading } = useQuery({ | ||
queryKey: ["badge"], | ||
queryFn: async () => { | ||
const { data } = await axioscom.get("/badge"); | ||
return data; | ||
}, | ||
}); | ||
if (isLoading) return <LogingSpiner></LogingSpiner>; | ||
return ( | ||
<div className="my-20"> | ||
<h2 className="text-3xl md:text-5xl font-bold md:ml-5"> | ||
Membership Pakages | ||
</h2> | ||
<div className=" grid md:grid-cols-3 gap-4 mt-10"> | ||
{badge.map((bag) => ( | ||
<Link | ||
to={`/dashbord/payment/${bag._id}`} | ||
className=" border-2 p-3" | ||
key={bag._id} | ||
> | ||
<img className=" w-full h-[250px]" src={bag.badgeImg} alt="" /> | ||
<p className="text-3xl">Price : $ {bag.price}</p> | ||
</Link> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PrimeMeal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.