feat: 新增玩法规则页并增强注单筛选与结果展示
This commit is contained in:
@@ -3,28 +3,44 @@
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
import { BarChart3, ClipboardList, Home, Wallet } from "lucide-react";
|
||||
import { BarChart3, BookOpen, ClipboardList, Home, Wallet } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const tabs = [
|
||||
{ href: "/hall", labelKey: "nav.home", icon: Home, match: (p: string) => p === "/hall" },
|
||||
{
|
||||
href: "/hall",
|
||||
labelKey: "nav.home",
|
||||
labelDefault: "首页",
|
||||
icon: Home,
|
||||
match: (p: string) => p === "/hall",
|
||||
},
|
||||
{
|
||||
href: "/results",
|
||||
labelKey: "nav.results",
|
||||
labelDefault: "开奖结果",
|
||||
icon: BarChart3,
|
||||
match: (p: string) => p === "/results" || p.startsWith("/results/"),
|
||||
},
|
||||
{
|
||||
href: "/orders",
|
||||
labelKey: "nav.orders",
|
||||
labelDefault: "我的注单",
|
||||
icon: ClipboardList,
|
||||
match: (p: string) => p === "/orders" || p.startsWith("/orders/"),
|
||||
},
|
||||
{
|
||||
href: "/rules",
|
||||
labelKey: "nav.rules",
|
||||
labelDefault: "规则",
|
||||
icon: BookOpen,
|
||||
match: (p: string) => p === "/rules",
|
||||
},
|
||||
{
|
||||
href: "/wallet",
|
||||
labelKey: "nav.wallet",
|
||||
labelDefault: "钱包",
|
||||
icon: Wallet,
|
||||
match: (p: string) => p === "/wallet" || p.startsWith("/wallet/"),
|
||||
},
|
||||
@@ -42,10 +58,10 @@ export function PlayerBottomNav() {
|
||||
className="fixed bottom-0 left-0 right-0 z-50 border-t border-[#e4ebf5] bg-white/96 pb-[env(safe-area-inset-bottom,0px)] shadow-[0_-10px_30px_rgba(15,23,42,0.08)] backdrop-blur-md"
|
||||
aria-label={t("nav.aria")}
|
||||
>
|
||||
<div className="mx-auto grid h-16 w-full max-w-lg grid-rows-1 [grid-template-columns:repeat(4,minmax(0,1fr))]">
|
||||
{tabs.map(({ href, labelKey, icon: Icon, match }) => {
|
||||
<div className="mx-auto grid h-16 w-full max-w-lg grid-rows-1 [grid-template-columns:repeat(5,minmax(0,1fr))]">
|
||||
{tabs.map(({ href, labelKey, labelDefault, icon: Icon, match }) => {
|
||||
const active = match(pathname);
|
||||
const label = t(labelKey);
|
||||
const label = t(labelKey, { defaultValue: labelDefault });
|
||||
return (
|
||||
<Link
|
||||
key={href}
|
||||
|
||||
@@ -17,6 +17,7 @@ type PlayerPanelProps = {
|
||||
backHref?: string;
|
||||
backLabel?: string;
|
||||
className?: string;
|
||||
containerClassName?: string;
|
||||
};
|
||||
|
||||
export function PlayerPanel({
|
||||
@@ -26,13 +27,14 @@ export function PlayerPanel({
|
||||
backHref = "/hall",
|
||||
backLabel,
|
||||
className,
|
||||
containerClassName,
|
||||
}: PlayerPanelProps) {
|
||||
const { t } = useTranslation("common");
|
||||
const { t: tp } = useTranslation("player");
|
||||
const resolvedBackLabel = backLabel ?? tp("panel.home");
|
||||
|
||||
return (
|
||||
<div className="mx-auto w-full max-w-[480px]">
|
||||
<div className={cn("mx-auto w-full max-w-[480px]", containerClassName)}>
|
||||
<section
|
||||
className={cn(
|
||||
"overflow-hidden bg-white px-4 pb-8 pt-4 text-slate-900",
|
||||
|
||||
Reference in New Issue
Block a user