Skip to content

Commit 95ce36b

Browse files
committed
feat: 文章详情
1 parent a43949c commit 95ce36b

File tree

14 files changed

+148
-13
lines changed

14 files changed

+148
-13
lines changed

src/Layout/index.less

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@
55
// max-width: 1200px;
66
// margin: 0 auto;
77
}
8+
.mainWrap {
9+
@media (min-width: 768px) {
10+
display: flex;
11+
flex-direction: column;
12+
min-height: 100vh;
13+
}
14+
}

src/Layout/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ const Layout: React.FC<AppProps> = ({ children }) => {
1111
const [searchVisible, setSearchVisible] = useState<boolean>(false);
1212
return (
1313
<>
14-
<Header setSearchVisible={setSearchVisible} />
15-
<main className={styles.main}>{children}</main>
14+
<div className={styles.mainWrap}>
15+
<Header setSearchVisible={setSearchVisible} />
16+
<main className={styles.main}>{children}</main>
17+
<Footer />
18+
</div>
1619
<Back />
1720
<Search visible={searchVisible} setVisible={setSearchVisible} />
18-
<Footer />
1921
</>
2022
);
2123
};

src/Pages/Archives/index.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.archivesWrap {
22
max-width: 1170px;
3-
width: 100%;
43
padding-right: 16px;
54
padding-left: 16px;
65
margin-right: auto;

src/Pages/Archives/index.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ const Archives: React.FC = () => {
2020
</h2>
2121
</div>
2222
</article>
23+
<article className={styles.post}>
24+
<div className={styles.inner}>
25+
<div className={styles.date}>2021/8/7</div>
26+
<h2>
27+
<a>Autumn is a second spring when every leaf is a flower</a>
28+
</h2>
29+
</div>
30+
</article>
31+
<article className={styles.post}>
32+
<div className={styles.inner}>
33+
<div className={styles.date}>2021/8/7</div>
34+
<h2>
35+
<a>Autumn is a second spring when every leaf is a flower</a>
36+
</h2>
37+
</div>
38+
</article>
2339
</li>
2440
</ul>
2541
</div>

src/Pages/Details/index.less

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.container {
2+
max-width: 1170px;
3+
padding-right: 16px;
4+
padding-left: 16px;
5+
margin-right: auto;
6+
margin-left: auto;
7+
}
8+
.innerWrap {
9+
max-width: 700px;
10+
margin-left: auto;
11+
margin-right: auto;
12+
}
13+
.postInfo {
14+
text-transform: uppercase;
15+
font-size: 0.875rem;
16+
color: #a1a6b1;
17+
color: var(--text-color-light);
18+
margin-bottom: 1rem;
19+
}
20+
21+
span {
22+
margin-right: 6px;
23+
margin-bottom: 8px;
24+
display: inline-flex;
25+
align-items: baseline;
26+
}
27+
.tag {
28+
border: 1px solid #e8e9eb;
29+
border: 1px solid var(--border-color);
30+
padding: 1px 6px;
31+
border-radius: 3px;
32+
font-size: 0.75rem;
33+
}
34+
.tags {
35+
&::after {
36+
content: '/';
37+
margin-left: 8px;
38+
}
39+
}
40+
.date {
41+
&::after {
42+
content: '/';
43+
margin-left: 8px;
44+
}
45+
}
46+
.title {
47+
margin-top: 0;
48+
margin-bottom: 1.5rem;
49+
h1 {
50+
color: #1a202b;
51+
color: var(--text-color-dark);
52+
font-weight: 400;
53+
line-height: 1.3;
54+
margin-bottom: 1rem;
55+
}
56+
}

src/Pages/Details/index.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from 'react';
2+
import styles from './index.less';
3+
const Details = () => {
4+
return (
5+
<div className={styles.main}>
6+
<div className={styles.container}>
7+
<div className={styles.innerWrap}>
8+
<div>
9+
<div className={styles.title}>
10+
<h1>标题sad撒按时</h1>
11+
</div>
12+
<div className={styles.postInfo}>
13+
<span className={styles.tags}>React</span>
14+
<span className={styles.date}> 2019-2-2</span>
15+
<span className={styles.viewer}>2000</span>
16+
<span className={styles.tag}>sddsdsd</span>
17+
</div>
18+
<article>
19+
<p>
20+
在 nodejs
21+
中,之前一直推荐的是url.parse方法来解析参数,不过这个方法已经不推荐了,现在推荐的是
22+
WHATWG 网址的 API。
23+
</p>
24+
<p>
25+
因为网上找到的都还是之前的方法,这里特此记录下,在 nodejs 中,如何使用 URL 类 或
26+
URLSearchParams 类来获取请求的参数。
27+
</p>
28+
</article>
29+
</div>
30+
</div>
31+
</div>
32+
</div>
33+
);
34+
};
35+
36+
export default Details;

src/Pages/Home/index.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.container {
22
padding-top: 20px;
33
max-width: 1170px;
4-
width: 100%;
54
padding-right: 16px;
65
display: flex;
76
flex-direction: row;

src/Pages/Home/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,18 @@ const Home: React.FC = () => {
8484
);
8585
})}
8686
</ul>
87-
<div className={styles.right}>个人中心</div>
87+
<div className={styles.right}>
88+
<p>关于我</p>
89+
Saima is a Ghost theme with high focus on typography and reading experience. It's sleek
90+
and clutter free UI design will encourage your visitors to stay and read on your site
91+
longer. This theme is perfect for a personal and professional blog. Also this theme can be
92+
used in any collaborative and multi author blog. For example travel blog, technology blog,
93+
lifestyle blog, health blog etc. This theme comes with light and dark mode you can set
94+
default color mode to dark or light. Also your visitor can choose their preferred mode. Do
95+
you write programming / coding related article or tutorial? this theme already comes with
96+
code syntax highlighter. It also let your user copy by a single click of a button. are not
97+
all these features amazing?
98+
</div>
8899
</div>
89100
</section>
90101
);

src/Pages/Tags/index.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.tagsWrap {
22
max-width: 1170px;
3-
width: 100%;
43
padding-right: 16px;
54
padding-left: 16px;
65
margin-right: auto;

src/components/Footer/index.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
width: 100%;
55
.container {
66
max-width: 1170px;
7-
width: 100%;
87
padding-right: 16px;
98
padding-left: 16px;
109
margin-right: auto;

0 commit comments

Comments
 (0)