Skip to content

Commit 3405109

Browse files
authored
Merge pull request #5 from cnodejs/feat/about
feat: add about page
2 parents f05fa9d + 593ec07 commit 3405109

File tree

6 files changed

+80
-11
lines changed

6 files changed

+80
-11
lines changed

config/routes.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ const routes: IRoute[] = [
1919
name: '主页',
2020
component: '@/page/topic',
2121
},
22-
22+
{
23+
path: '/about',
24+
exact: true,
25+
icon: 'info',
26+
name: '关于',
27+
component: '@/page/about',
28+
},
2329
{
2430
path: '/api',
2531
exact: true,

src/layout/component/AppQrcode.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
import ProCard from '@ant-design/pro-card';
3+
4+
const AppQrcode: React.FC<Props> = (props) => {
5+
return (
6+
<ProCard title="客户端二维码" headerBordered>
7+
<div
8+
style={{
9+
display: 'flex',
10+
flexDirection: 'column',
11+
alignItems: 'center',
12+
}}
13+
>
14+
<img
15+
width={200}
16+
src="https://static.cnodejs.org/FtG0YVgQ6iginiLpf9W4_ShjiLfU"
17+
alt="客户端二维码"
18+
/>
19+
<span>客户端源码地址</span>
20+
</div>
21+
</ProCard>
22+
);
23+
};
24+
25+
export default AppQrcode;
26+
27+
interface Props {}

src/layout/component/UserInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const UserInfo: React.FC<Props> = (props) => {
4242
};
4343

4444
return (
45-
<ProCard title="个人信息">
45+
<ProCard title="个人信息" headerBordered>
4646
<Space size={8}>
4747
<Avatar shape="square" size="small" src={avatar_url} />
4848
<span>{loginname}</span>

src/layout/index.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import ProCard from '@ant-design/pro-card';
33

44
import { IRoute, Link } from 'umi';
55
import { PageContainer } from '@ant-design/pro-layout';
6-
import { Affix, Button } from 'antd';
6+
import { Affix, Button, Space } from 'antd';
77
import { UpCircleOutlined } from '@ant-design/icons';
88

99
import UserInfo from './component/UserInfo';
10+
import AppQrcode from './component/AppQrcode';
1011

1112
const getCurrentRoute = (route: IRoute, path: string): IRoute | undefined => {
1213
let target;
@@ -71,16 +72,17 @@ const Layout: React.FC<React.PropsWithChildren<Props>> = (props) => {
7172
bordered={false}
7273
ghost
7374
colSpan={{
74-
xs: '50px',
75-
sm: '100px',
76-
md: '200px',
77-
lg: '300px',
78-
xl: '400px',
75+
sm: '200px',
76+
md: '400px',
7977
}}
8078
>
81-
<UserInfo />
79+
<Space size={16} direction="vertical" style={{ width: '100%' }}>
80+
<UserInfo />
81+
<AppQrcode />
82+
</Space>
8283
</ProCard>
8384
</ProCard>
85+
8486
<Affix
8587
offsetBottom={50}
8688
style={{

src/page/about/index.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React from 'react';
2+
import Markdown from '@/component/Markdown';
3+
4+
const content = `
5+
## 关于
6+
7+
- CNode 社区为国内最大最具影响力的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
8+
9+
- CNode 社区由一批热爱 Node.js 技术的工程师发起,目前已经吸引了互联网各个公司的专业技术人员加入,我们非常欢迎更多对 Node.js 感兴趣的朋友。
10+
11+
- CNode 的 SLA 保证是,一个9,即 90.000000%。
12+
13+
社区目前由 [@alsotang](http://cnodejs.org/user/alsotang) 在维护,有问题请联系:[https://github.com/alsotang](https://github.com/alsotang)
14+
15+
请关注我们的官方微博:[http://weibo.com/cnodejs](http://weibo.com/cnodejs)
16+
17+
## 客户端
18+
19+
- 客户端由 [@soliury](https://cnodejs.org/user/soliury) 开发维护。
20+
21+
- 源码地址: [https://github.com/soliury/noder-react-native](https://github.com/soliury/noder-react-native) 。
22+
23+
立即体验 CNode 客户端,直接扫描页面右侧二维码。
24+
25+
另,安卓用户同时可选择:[https://github.com/TakWolf/CNode-Material-Design](https://github.com/TakWolf/CNode-Material-Design) ,这是 Java 原生开发的安卓客户端。
26+
`;
27+
28+
const AboutPage: React.FC<Props> = (props) => {
29+
return <Markdown type="render" value={content} />;
30+
};
31+
32+
export default AboutPage;
33+
34+
interface Props {}

src/page/home/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22

3-
const Home: React.FC<Props> = () => {
3+
const HomePage: React.FC<Props> = () => {
44
return null;
55
};
66

7-
export default Home;
7+
export default HomePage;
88

99
interface Props {}

0 commit comments

Comments
 (0)