Skip to content

Commit

Permalink
feat:优化
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Jeff committed Aug 17, 2024
1 parent 90cc340 commit 8cea4b7
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 40 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"react-dom": "^18",
"react-query": "^3.39.3",
"react-seat-picker": "^1.5.3",
"react-type-animation": "^3.2.0",
"tailwind-merge": "^2.3.0",
"tailwindcss": "^3.3.0",
"viem": "2.x",
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function RootLayout({ children }: { children: React.ReactNode }) {
<Theme>
<Providers>
<Navbar />
<main className="min-h-[calc(100vh-190px)]">{children}</main>
<main className="min-h-[calc(100vh-250px)]">{children}</main>
<Footer />
</Providers>
</Theme>
Expand Down
11 changes: 6 additions & 5 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"use client";

import HallSection from "@/components/hall-section";
import { useAccount } from "wagmi";

export default function Page() {
return (
<div>
{/* <HeroSection /> */}
<HallSection />
const account = useAccount();

</div>
return (
account?.isConnected && account?.chain?.name === "Sepolia" ? <HallSection /> : <div className="text-center mt-20 margin-auto text-4xl font-bold">Please connect wallet</div>
);
}
30 changes: 9 additions & 21 deletions src/app/seats/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
"use client";

import React, { useState } from "react";
import { useRouter, useParams } from "next/navigation";
import { useParams } from "next/navigation";
import SeatPicker from "react-seat-picker";
import {
Badge,
Box,
Text,
Tabs,
Button,
Dialog,
Strong,
Flex,
Spinner,
} from "@radix-ui/themes";
import { Cross1Icon } from "@radix-ui/react-icons";
import {
Container, Row, Col, Card,
Container, Card,
} from "react-bootstrap";
import "@/styles/seats.css";
import clsx from "clsx";
Expand All @@ -25,20 +20,13 @@ import {
} from "@nextui-org/react";

function Seats() {
const [loading, setLoading] = useState(true);
const [selected, setSelected] = useState("");
const [startPrice, setStartPrice] = useState("");
const [bidPrice, setBidPrice] = useState("");
const [floorPrice, setFloorPrice] = useState("");
const [reserveDuration, setReserveDuration] = useState("");
const [interval, setInterval] = useState("");
const [decayInterval, setDecayInterval] = useState("");
const [decayAmount, setDecayAmount] = useState("");
const [errMsg, setErrMsg] = useState("");
const [open, setOpen] = useState(false);

const router = useRouter();
const { hallId } = useParams();
const { slug } = useParams();
const rows = [
[
{ id: 1, number: "A1" },
Expand All @@ -50,11 +38,11 @@ function Seats() {
{ id: 44, number: "A7" },
{ id: 54, number: "A8" },
null,
{ id: 5, number: "A8" },
{ id: 6, number: "A9" },
{ id: 7, number: "A10" },
{ id: 8, number: "A11" },
{ id: 9, number: "A12", isReserved: true },
{ id: 5, number: "A9" },
{ id: 6, number: "A10" },
{ id: 7, number: "A11" },
{ id: 8, number: "A12" },
{ id: 9, number: "A13", isReserved: true },
],
[
{ id: 11, number: "B1" },
Expand Down Expand Up @@ -178,7 +166,7 @@ function Seats() {
<Container className="mt-5 container">
<h2>
当前放映厅:
{hallId}
{slug}
</h2>
<div className="screens">
<h3 className="screen">SCREEN</h3>
Expand Down
30 changes: 17 additions & 13 deletions src/components/navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ import { cn } from "@/lib/utils";
import { ConnectButton } from "@rainbow-me/rainbowkit";

import { useRouter } from "next/navigation";
import Image from "next/image";
import { Icon } from "@iconify/react";
import AvatarDiv from "../avatar";
import TooltipProvider from "../tooltip";
import logo from "/public/logo.png";
import { useAccount } from "wagmi";

export const Navbar = () => {
const scroll = useScroll(() => document);
const router = useRouter();
const account = useAccount();
const isShowAvatar = account?.isConnected && account?.chain?.name === "Sepolia";
return (
<header
className={cn(
Expand All @@ -28,15 +27,20 @@ export const Navbar = () => {
>
<div className="w-full flex justify-center items-center h-16 md:max-w-screen-lg 2xl:max-w-screen-xl">
<ConnectButton />
<Icon
icon="icon-park-solid:avatar"
className="cursor-pointer ml-5"
width="30"
height="30"
onClick={() => {
router.push("/personal");
}}
/>
{
isShowAvatar && (
<Icon
icon="icon-park-solid:avatar"
className="cursor-pointer ml-5"
width="30"
height="30"
onClick={() => {
router.push("/personal");
}}
/>
)
}

</div>
</header>
);
Expand Down

0 comments on commit 8cea4b7

Please sign in to comment.