update
This commit is contained in:
BIN
app/assets/backtop.png
Normal file
BIN
app/assets/backtop.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@ -157,6 +157,7 @@ const AnhuiSwiper = () => {
|
||||
>
|
||||
<img
|
||||
src={`${process.env.NEXT_PUBLIC_ADMIN_BASE_URL}${el.path}`}
|
||||
alt={""}
|
||||
/>
|
||||
{/*@ts-ignore*/}
|
||||
</swiper-slide>
|
||||
|
19
app/components/BackToTop.tsx
Normal file
19
app/components/BackToTop.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
import backTop from "@/app/assets/backtop.png";
|
||||
import Image from "next/image";
|
||||
// import { useScroll } from "ahooks";
|
||||
|
||||
const BackToTop = () => {
|
||||
// const position = useScroll();
|
||||
return (
|
||||
<div className={`fixed bottom-4 right-10 w-[50px] h-[50px]`}>
|
||||
<Image
|
||||
className={"w-full h-full cursor-pointer"}
|
||||
src={backTop}
|
||||
alt={""}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default BackToTop;
|
@ -1,15 +1,23 @@
|
||||
"use client";
|
||||
import styles from "@/app/assets/page.module.css";
|
||||
import Image from "next/image";
|
||||
import trumpetIcon from "@/app/assets/trumpet-icon.png";
|
||||
import { articleDetail, listArticles } from "@/app/api/articles";
|
||||
import { htmlToText } from "html-to-text";
|
||||
import Link from "next/link";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Article } from "@/app/types/article";
|
||||
|
||||
// TODO:
|
||||
// const [lists, setLists] = useState<Article[]>([]);
|
||||
// useEffect(() => {
|
||||
// listArticles({ cid: "13" }).then((res) => {
|
||||
// setLists(() => res.lists);
|
||||
// });
|
||||
// }, []);
|
||||
const BranchLifeSketch = async () => {
|
||||
const { lists } = await listArticles({ cid: "13" });
|
||||
return (
|
||||
<div>
|
||||
<>
|
||||
<div
|
||||
className={`title-bar text-white flex items-center px-2 font-bold ${styles.articleBlockTitleBar} relative`}
|
||||
>
|
||||
@ -76,7 +84,7 @@ const BranchLifeSketch = async () => {
|
||||
{/*@ts-ignore*/}
|
||||
</swiper-container>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Inter } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import Link from "next/link";
|
||||
import footer from "@/app/assets/footer.jpg";
|
||||
import Image from "next/image";
|
||||
import banner from "@/app/assets/banner.jpg";
|
||||
import { ReactNode } from "react";
|
||||
import MainNav from "@/app/components/MainNav";
|
||||
import BackToTop from "@/app/components/BackToTop";
|
||||
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
||||
@ -25,6 +25,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
{children}
|
||||
<Image src={footer} alt={"footer"} className={"mt-4"} />
|
||||
</main>
|
||||
<BackToTop />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
@ -81,9 +81,7 @@ export default async function Home() {
|
||||
target="_blank"
|
||||
/>
|
||||
</map>
|
||||
<div className={"mt-1"}>
|
||||
<BranchLifeSketch />
|
||||
</div>
|
||||
<div className={"mt-1"}>{/*<BranchLifeSketch />*/}</div>
|
||||
</div>
|
||||
<div className={"main-content w-[540px]"}>
|
||||
<LatestNews />
|
||||
|
Reference in New Issue
Block a user