diff --git a/components/PostPreview.js b/components/PostPreview.js index f56395f..a9b2011 100644 --- a/components/PostPreview.js +++ b/components/PostPreview.js @@ -1,16 +1,27 @@ import styles from "../styles/Home.module.css"; import Link from "next/link"; +import Image from "next/image"; import ClickForMore from "./ClickForMore"; -function PostPreview({ title, description, date, href }) { +function PostPreview({ title, description, date, href, bg }) { return ( -
-

{title}

-

{description}

- 发布于 {date} - {" | "} - +
+
+

{title}

+

{description}

+ 发布于 {date} + {" | "} + +
+
+ {bg && } +
); diff --git a/pages/index.js b/pages/index.js index ea2f9fa..f82ac4f 100644 --- a/pages/index.js +++ b/pages/index.js @@ -7,6 +7,9 @@ import mainbg from "../public/mainbg.webp"; // styles import styles from "../styles/Home.module.css"; +import bg486 from "../public/486.webp"; +import bgmap from "../public/typhoon.png"; + export default function Home() { return (
@@ -31,6 +34,7 @@ export default function Home() { title="社会管理法律" description="小组研讨真实法律案件的案情和判决" date="2022-07-06" + bg={bg486} />
diff --git a/styles/Home.module.css b/styles/Home.module.css index 2612777..83ed7b9 100644 --- a/styles/Home.module.css +++ b/styles/Home.module.css @@ -7,5 +7,12 @@ .postPreview { padding: 0.5rem; border-radius: 1rem; +} + +.postPreviewWrap { + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; cursor: pointer; }