|
1 |
| -"use client" |
2 |
| - |
3 |
| -import React from "react"; |
4 |
| -import styles from "./home.module.scss"; |
5 |
| -import { Item } from "./more"; |
6 |
| - |
7 |
| -interface TopicProps { |
8 |
| - title: string; |
9 |
| - count: number; |
10 |
| -} |
11 |
| - |
12 |
| -function Introduce() { |
13 |
| - return ( |
14 |
| - <> |
15 |
| - <div className="flex items-center"> |
16 |
| - <img src="https://journal.ghost.io/content/images/2021/06/Logo.png" alt="The Ardor" className="mr-4" /> |
17 |
| - <div> |
18 |
| - <div className="text-lg font-semibold">The Ardor</div> |
19 |
| - <div className="text-slate-600">Thoughts,stories and ideas.</div> |
20 |
| - </div> |
21 |
| - </div> |
22 |
| - <div className="mt-8 text-slate-600">Sign up now to get access to the library of members-only issues.</div> |
23 |
| - {/* <Button className="w-full mt-8">Subscribe</Button> */} |
24 |
| - </> |
25 |
| - ) |
26 |
| -} |
27 |
| - |
28 |
| -function Topic({ title, count }: TopicProps) { |
29 |
| - const handleClick = () => { |
30 |
| - console.log("Click!") |
31 |
| - } |
32 |
| - return ( |
33 |
| - <> |
34 |
| - <div className={styles.topicItem} onClick={handleClick}> |
35 |
| - <div className="text-xl font-semibold">{title}</div> |
36 |
| - <div className="px-2 text-sm border rounded-2xl">{count} issues</div> |
37 |
| - </div> |
38 |
| - </> |
39 |
| - ) |
40 |
| -} |
41 |
| - |
42 |
| - |
43 |
| -function SiderItem({ title, children }: { title: string, children: React.ReactNode }) { |
44 |
| - return ( |
45 |
| - <> |
46 |
| - <div className={styles.title}>{title}</div> |
47 |
| - {children} |
48 |
| - </> |
49 |
| - ) |
50 |
| -} |
51 |
| - |
52 |
| -export default function About() { |
53 |
| - const list = [ |
54 |
| - { |
55 |
| - date: "JUN 28, 2021", |
56 |
| - title: "Start here for a quick overview of everything you need to know", |
57 |
| - content: "We've crammed the most important information to help you get started with Ghost into this one post. It's your cheat-sheet to get started, and your shortcut to advanced features.", |
58 |
| - readTime: "2 min" |
59 |
| - }, |
60 |
| - { |
61 |
| - date: "JUN 28, 2021", |
62 |
| - title: "Start here for a quick overview of everything you need to know", |
63 |
| - content: "We've crammed the most important information to help you get started with Ghost into this one post. It's your cheat-sheet to get started, and your shortcut to advanced features.", |
64 |
| - readTime: "2 min" |
65 |
| - } |
66 |
| - ] |
67 |
| - // 主题列表 |
68 |
| - const topicList = [ |
69 |
| - { |
70 |
| - title: "Getting Started", |
71 |
| - count: 7 |
72 |
| - }, |
73 |
| - { |
74 |
| - title: "Speeches", |
75 |
| - count: 1 |
76 |
| - } |
77 |
| - ] |
78 |
| - return ( |
79 |
| - <div className="sticky pl-12 top-4 h-max"> |
80 |
| - <SiderItem title="ABOUT"> |
81 |
| - <Introduce></Introduce> |
82 |
| - </SiderItem> |
83 |
| - <SiderItem title="FEATURED"> |
84 |
| - {list.map(it => { |
85 |
| - return <Item info={it} mini={true} /> |
86 |
| - })} |
87 |
| - </SiderItem> |
88 |
| - <SiderItem title="TOPICS"> |
89 |
| - {topicList.map(it => { |
90 |
| - return <Topic title={it.title} count={it.count} /> |
91 |
| - })} |
92 |
| - </SiderItem> |
93 |
| - </div> |
94 |
| - ) |
95 |
| -} |
| 1 | +"use client" |
| 2 | + |
| 3 | +import React from "react"; |
| 4 | +import styles from "./home.module.scss"; |
| 5 | +import { Item } from "./more"; |
| 6 | + |
| 7 | +interface TopicProps { |
| 8 | + title: string; |
| 9 | + count: number; |
| 10 | +} |
| 11 | + |
| 12 | +function Introduce() { |
| 13 | + return ( |
| 14 | + <> |
| 15 | + <div className="flex items-center"> |
| 16 | + <img src="https://journal.ghost.io/content/images/2021/06/Logo.png" alt="The Ardor" className="mr-4" /> |
| 17 | + <div> |
| 18 | + <div className="text-lg font-semibold">The Ardor</div> |
| 19 | + <div className="text-slate-600">Thoughts,stories and ideas.</div> |
| 20 | + </div> |
| 21 | + </div> |
| 22 | + <div className="mt-8 text-slate-600">Sign up now to get access to the library of members-only issues.</div> |
| 23 | + {/* <Button className="w-full mt-8">Subscribe</Button> */} |
| 24 | + </> |
| 25 | + ) |
| 26 | +} |
| 27 | + |
| 28 | +function Topic({ title, count }: TopicProps) { |
| 29 | + const handleClick = () => { |
| 30 | + console.log("Click!") |
| 31 | + } |
| 32 | + return ( |
| 33 | + <> |
| 34 | + <div className={styles.topicItem} onClick={handleClick}> |
| 35 | + <div className="text-xl font-semibold">{title}</div> |
| 36 | + <div className="px-2 text-sm border rounded-2xl">{count} issues</div> |
| 37 | + </div> |
| 38 | + </> |
| 39 | + ) |
| 40 | +} |
| 41 | + |
| 42 | + |
| 43 | +function SiderItem({ title, children }: { title: string, children: React.ReactNode }) { |
| 44 | + return ( |
| 45 | + <> |
| 46 | + <div className={styles.title}>{title}</div> |
| 47 | + {children} |
| 48 | + </> |
| 49 | + ) |
| 50 | +} |
| 51 | + |
| 52 | +export default function About() { |
| 53 | + const list = [ |
| 54 | + { |
| 55 | + date: "JUN 28, 2021", |
| 56 | + title: "Start here for a quick overview of everything you need to know", |
| 57 | + content: "We've crammed the most important information to help you get started with Ghost into this one post. It's your cheat-sheet to get started, and your shortcut to advanced features.", |
| 58 | + readTime: "2 min" |
| 59 | + }, |
| 60 | + { |
| 61 | + date: "JUN 28, 2021", |
| 62 | + title: "Start here for a quick overview of everything you need to know", |
| 63 | + content: "We've crammed the most important information to help you get started with Ghost into this one post. It's your cheat-sheet to get started, and your shortcut to advanced features.", |
| 64 | + readTime: "2 min" |
| 65 | + } |
| 66 | + ] |
| 67 | + // 主题列表 |
| 68 | + const topicList = [ |
| 69 | + { |
| 70 | + title: "Getting Started", |
| 71 | + count: 7 |
| 72 | + }, |
| 73 | + { |
| 74 | + title: "Speeches", |
| 75 | + count: 1 |
| 76 | + } |
| 77 | + ] |
| 78 | + return ( |
| 79 | + <div className="sticky pl-12 top-4 h-max"> |
| 80 | + <SiderItem title="ABOUT"> |
| 81 | + <Introduce></Introduce> |
| 82 | + </SiderItem> |
| 83 | + <SiderItem title="FEATURED"> |
| 84 | + {list.map(it => { |
| 85 | + return <Item info={it} mini={true} /> |
| 86 | + })} |
| 87 | + </SiderItem> |
| 88 | + <SiderItem title="TOPICS"> |
| 89 | + {topicList.map(it => { |
| 90 | + return <Topic title={it.title} count={it.count} /> |
| 91 | + })} |
| 92 | + </SiderItem> |
| 93 | + </div> |
| 94 | + ) |
| 95 | +} |
0 commit comments