From 4f5fda5024cfcbd41743f86192fda35d2d139eb0 Mon Sep 17 00:00:00 2001 From: feng Date: Sat, 17 Aug 2024 17:17:20 +0800 Subject: [PATCH] =?UTF-8?q?pref=EF=BC=9Atree=20Shaking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/layout.tsx | 2 +- src/app/seats/[slug]/page.tsx | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4b1cc64..feaa9fb 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -2,11 +2,11 @@ import "./globals.css"; import "@rainbow-me/rainbowkit/styles.css"; import "@radix-ui/themes/styles.css"; import { Navbar } from "@/components/navbar"; +import Footer from "@/components/footer"; import { Theme } from "@radix-ui/themes"; import React from "react"; import { Providers } from "./providers"; import "bootstrap/dist/css/bootstrap.min.css"; -import Footer from "@/components/footer"; function RootLayout({ children }: { children: React.ReactNode }) { return ( diff --git a/src/app/seats/[slug]/page.tsx b/src/app/seats/[slug]/page.tsx index a54bc32..3ee49e2 100644 --- a/src/app/seats/[slug]/page.tsx +++ b/src/app/seats/[slug]/page.tsx @@ -144,7 +144,10 @@ function Seats() { ]; const price = 30; const totalprice = price * (selected ? 1 : 0); - + const removeSeatCallback = ({ row, number }, removeCb) => { + setSelected(null); + removeCb(row, number); + }; const addSeatCallback = ({ row, number, id }, addCb, removeCb) => { // 如果已有选中的座位,先取消选中 if (selected) { @@ -157,11 +160,6 @@ function Seats() { addCb(row, number, id, newTooltip); }; - const removeSeatCallback = ({ row, number }, removeCb) => { - setSelected(null); - removeCb(row, number); - }; - return (