diff --git a/admin/pages/admins/index.tsx b/admin/pages/admins/index.tsx index e8c9df9..63340cf 100644 --- a/admin/pages/admins/index.tsx +++ b/admin/pages/admins/index.tsx @@ -23,7 +23,7 @@ const AdminsPage = () => { const { data, error } = await supabase .from("admins_roles_restaurants") .select("*, admins(id, name, email), roles(name)") - .order('id', { ascending: false }) + .order("id", { ascending: false }) .range((page - 1) * pageSize, pageSize * page - 1) .eq("restaurant_id", user.split("/")[2]) .neq("admin_id", user.split("/")[0]); @@ -71,13 +71,12 @@ const AdminsPage = () => { fetchAdmins(currentPage); }, [currentPage]); - const deleteRecord = async (id: number, relativeId: number) => { + const deleteRecord = async (id: number) => { try { - await supabase.from("admins").delete().eq("id", id).throwOnError(); await supabase .from("admins_roles_restaurants") .delete() - .eq("id", relativeId) + .eq("id", id) .throwOnError(); setAdminsData(adminsData.filter((x) => x.id != id)); fetchCountAdmins(); @@ -188,7 +187,7 @@ const AdminsPage = () => { className="text-red" onClick={() => confirm("Are you sure you want to delete this admin?") - ? deleteRecord(admin.admins.id, admin.id) + ? deleteRecord(admin.id) : "" } > diff --git a/admin/pages/invited-members/add/index.tsx b/admin/pages/invited-members/add/index.tsx index ca4824e..73cf71b 100644 --- a/admin/pages/invited-members/add/index.tsx +++ b/admin/pages/invited-members/add/index.tsx @@ -96,7 +96,7 @@ const InvitedMemberPage = () => { await sendEmail({ to: email, - subject: "Bite Space - Invitation To Join Space", + subject: "Invitation To Join Space", message: render( InviteMemberEmail({ invited_by: data.admins.name, diff --git a/website/components/BottomSheet/index.tsx b/website/components/BottomSheet/index.tsx index fa08f84..686a930 100644 --- a/website/components/BottomSheet/index.tsx +++ b/website/components/BottomSheet/index.tsx @@ -31,23 +31,31 @@ const BottomSheet = ({ }; }, [isOpen, onClose]); + const handleClose = () => { + if (window.history.state?.bottomSheetOpen) { + window.history.back(); + } else { + onClose(); + } + }; + return (
-
+ {/*
*/}
| -

{name} dishes

+

{name}

diff --git a/website/components/Reel/index.tsx b/website/components/Reel/index.tsx index 7a78cfe..f8aef8e 100644 --- a/website/components/Reel/index.tsx +++ b/website/components/Reel/index.tsx @@ -83,7 +83,16 @@ const Reels = ({ dishesData }: ReelProps) => { return (
- {isLoading ? : ""} + {isLoading ? ( + + ) : ( + "" + )}
{ {!isLoading ? (
{data.video ? ( - +
+ +
) : ( )} diff --git a/website/components/SkeletonPlaceholders/MenuDish.tsx b/website/components/SkeletonPlaceholders/MenuDish.tsx index 565d26e..2760ca9 100644 --- a/website/components/SkeletonPlaceholders/MenuDish.tsx +++ b/website/components/SkeletonPlaceholders/MenuDish.tsx @@ -1,7 +1,8 @@ -const MenuDishSkeleton = ({ classes }: any) => { +const MenuDishSkeleton = ({ classes, style }: any) => { return (
diff --git a/website/pages/category/restaurant.tsx b/website/pages/category/restaurant.tsx index c780290..f95dcf8 100644 --- a/website/pages/category/restaurant.tsx +++ b/website/pages/category/restaurant.tsx @@ -2,7 +2,7 @@ import BottomSheet from "@/components/BottomSheet"; import NoDataFound from "@/components/NoDataFound"; -import { useAppDispatch, useAppSelector } from "@/store/store"; +import { useAppDispatch } from "@/store/store"; import { RestaurantData } from "@/types/category-by-id"; import Image from "next/image"; import Link from "next/link"; @@ -12,7 +12,6 @@ import { Swiper, SwiperSlide } from "swiper/react"; import "swiper/css"; import "swiper/css/pagination"; -import { Autoplay, Pagination } from "swiper/modules"; import { setScreenHeightState } from "@/store/slice"; const Restaurant = ({ @@ -49,7 +48,7 @@ const Restaurant = ({ ); }, [dispatch]); - return ( + return ( <> {restaurantsData && restaurantsData.length > 0 ? (
@@ -82,8 +81,6 @@ const Restaurant = ({ {item.menu.map((data, index) => ( @@ -134,7 +131,7 @@ const Restaurant = ({ width={100} />
-

+

{data.name}

diff --git a/website/pages/restaurants/[restaurant]/categories/[category].tsx b/website/pages/restaurants/[restaurant]/categories/[category].tsx index 429fe27..56caab5 100644 --- a/website/pages/restaurants/[restaurant]/categories/[category].tsx +++ b/website/pages/restaurants/[restaurant]/categories/[category].tsx @@ -212,7 +212,7 @@ const RestaurantCategory = ({ Back | -

{categoryData.name} dishes

+

{categoryData.name}

{ Back | -

{menuName} dishes

+

{menuName}