|
@@ -2,16 +2,23 @@
|
|
|
import { Category, GameListRep, searchGameListApi, SearchProps } from "@/api/home";
|
|
|
import Box from "@/components/Box";
|
|
|
import GroupCard from "@/components/Card/GroupCard";
|
|
|
+import HeaderBack from "@/components/HeaderBack";
|
|
|
import { Pagination } from "@/types";
|
|
|
import { useSetState } from "ahooks";
|
|
|
import { InfiniteScroll } from "antd-mobile";
|
|
|
import { FC, useRef } from "react";
|
|
|
interface Props {
|
|
|
- searchParams: { gameListFlag: string; type: 1 | 2; bet_type: Category["bet_type"] };
|
|
|
+ searchParams: {
|
|
|
+ gameListFlag: string;
|
|
|
+ type: 1 | 2;
|
|
|
+ bet_type: Category["bet_type"];
|
|
|
+ name: string;
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
const GameListFlag: FC<Props> = (props) => {
|
|
|
const { searchParams } = props;
|
|
|
+
|
|
|
const [target, setTarget] = useSetState<{ games: GameListRep[]; page: Partial<Pagination> }>({
|
|
|
games: [],
|
|
|
page: { is_end: false },
|
|
@@ -40,14 +47,19 @@ const GameListFlag: FC<Props> = (props) => {
|
|
|
await getGames();
|
|
|
};
|
|
|
return (
|
|
|
- <Box>
|
|
|
- <GroupCard
|
|
|
- data={target.games}
|
|
|
- row={1}
|
|
|
- groupType={Number(searchParams.bet_type) as Category["bet_type"]}
|
|
|
- />
|
|
|
- <InfiniteScroll loadMore={loadMore} hasMore={!target.page.is_end!} />
|
|
|
- </Box>
|
|
|
+ <>
|
|
|
+ <HeaderBack showBack={true} title={searchParams.name} />
|
|
|
+ <main className={"main-header bg-[#1f1f1f]"}>
|
|
|
+ <Box>
|
|
|
+ <GroupCard
|
|
|
+ data={target.games}
|
|
|
+ row={1}
|
|
|
+ groupType={Number(searchParams.bet_type) as Category["bet_type"]}
|
|
|
+ />
|
|
|
+ <InfiniteScroll loadMore={loadMore} hasMore={!target.page.is_end!} />
|
|
|
+ </Box>
|
|
|
+ </main>
|
|
|
+ </>
|
|
|
);
|
|
|
};
|
|
|
|