|
@@ -5,8 +5,12 @@ import { FC, PropsWithChildren, ReactNode, Suspense } from "react";
|
|
|
import DownloadSection from "./_home/DownloadSection";
|
|
|
|
|
|
import { GroupType } from "@/api/home";
|
|
|
+import {
|
|
|
+ NoticePlaceHolder,
|
|
|
+ PrizePlaceHolder,
|
|
|
+ SwiperPlaceHolder,
|
|
|
+} from "@/app/[locale]/(TabBar)/[[...share]]/Placeholder";
|
|
|
import { server } from "@/utils/server";
|
|
|
-import Loading from "@/components/Loading";
|
|
|
|
|
|
const TIME = 0;
|
|
|
const getGames = async () => {
|
|
@@ -44,12 +48,8 @@ type Props = {
|
|
|
};
|
|
|
|
|
|
const Placeholder = () => {
|
|
|
- return (
|
|
|
- <div className={'flex justify-center'}>
|
|
|
- <Loading/>
|
|
|
- </div>
|
|
|
- )
|
|
|
-}
|
|
|
+ return <div className={"flex justify-center"}>{/*<Loading/>*/}</div>;
|
|
|
+};
|
|
|
const Layout: FC<PropsWithChildren<Props>> = async (props) => {
|
|
|
const {
|
|
|
children,
|
|
@@ -73,26 +73,18 @@ const Layout: FC<PropsWithChildren<Props>> = async (props) => {
|
|
|
<Header></Header>
|
|
|
<main id="maincontainer" className={"main-header"}>
|
|
|
{/*弹窗*/}
|
|
|
- <Suspense fallback={<Placeholder/>}>{popupWidget}</Suspense>
|
|
|
+ <Suspense fallback={<Placeholder />}>{popupWidget}</Suspense>
|
|
|
<Box>
|
|
|
{/* swiper */}
|
|
|
- <Suspense fallback={<Placeholder/>}
|
|
|
- >
|
|
|
- {swiperWidget}
|
|
|
- </Suspense>
|
|
|
+ <Suspense fallback={<SwiperPlaceHolder />}>{swiperWidget}</Suspense>
|
|
|
</Box>
|
|
|
{/* swiper下的活动 */}
|
|
|
<Box none className="px-[.12rem]">
|
|
|
- <Suspense fallback={<Placeholder/>}>
|
|
|
{cardWidget}
|
|
|
- </Suspense>
|
|
|
</Box>
|
|
|
{/* 跑马灯 */}
|
|
|
<Box none className="px-[.12rem]">
|
|
|
-
|
|
|
- <Suspense fallback={<Placeholder/>}>
|
|
|
- {noticeWidget}
|
|
|
- </Suspense>
|
|
|
+ <Suspense fallback={<NoticePlaceHolder />}>{noticeWidget}</Suspense>
|
|
|
</Box>
|
|
|
|
|
|
{/* <Box>
|
|
@@ -102,25 +94,18 @@ const Layout: FC<PropsWithChildren<Props>> = async (props) => {
|
|
|
{/*体育轮播*/}
|
|
|
{/* <Box> {sportSwiperWidget}</Box> */}
|
|
|
{/* 搜索下面的大奖展示 */}
|
|
|
- <Suspense fallback={<Placeholder/>}>
|
|
|
- {prizeWidget}
|
|
|
- </Suspense>
|
|
|
+ <Suspense fallback={<PrizePlaceHolder />}>{prizeWidget}</Suspense>
|
|
|
|
|
|
{/* 搜索组件 */}
|
|
|
{/* <Box none className="mb-[.2rem] px-[.12rem]">
|
|
|
{searchWidget}
|
|
|
</Box> */}
|
|
|
{/* tabs 和 游戏列表 */}
|
|
|
- <Suspense fallback={<Placeholder/>}>
|
|
|
- {children}
|
|
|
- </Suspense>
|
|
|
+ <Suspense fallback={<PrizePlaceHolder />}>{children}</Suspense>
|
|
|
|
|
|
{/*媒体*/}
|
|
|
<Box none className="mt-[.2rem]">
|
|
|
-
|
|
|
- <Suspense fallback={<Placeholder/>}>
|
|
|
- {mediaWidget}
|
|
|
- </Suspense>
|
|
|
+ <Suspense fallback={<Placeholder />}>{mediaWidget}</Suspense>
|
|
|
</Box>
|
|
|
{/* {React.Children.map(children,(child:any)=>{
|
|
|
console.log(child)
|
|
@@ -129,9 +114,7 @@ const Layout: FC<PropsWithChildren<Props>> = async (props) => {
|
|
|
})} */}
|
|
|
{/* {React.cloneElement(children,{group})} */}
|
|
|
{/*底部信息*/}
|
|
|
- <Suspense fallback={<Placeholder/>}>
|
|
|
- {actionWidget}
|
|
|
- </Suspense>
|
|
|
+ <Suspense fallback={<Placeholder />}>{actionWidget}</Suspense>
|
|
|
</main>
|
|
|
</>
|
|
|
);
|