Skip to content

Commit 77e9198

Browse files
author
berwin han
committed
refactor: move home code
1 parent 9ab76f2 commit 77e9198

File tree

4 files changed

+116
-89
lines changed

4 files changed

+116
-89
lines changed

src/pages/baseComponentsDemo/index.tsx

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/pages/home/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React, { Fragment, useEffect } from 'react';
22
import { connect } from 'dva';
3-
import { Carousel } from 'antd';
3+
44
import Header from 'component/common/BasicHeader';
55
import Footer from 'component/common/BasicFooter';
66
import Banner from 'component/home/Banner';
77
import Content from 'component/home/Content';
88
import Join from 'component/home/Join';
9-
import styles from './styles.less';
9+
1010

1111
function Home({ currentUser, dispatch, ...props }) {
1212
console.log(currentUser, props);

src/pages/index.jsx

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
/**
2+
* 注释路由
3+
* title:Index Page
4+
* Routes:- ./src/pages/display/index.tsx
5+
* - ./src/pages/display/index.tsx
6+
*/
7+
8+
import React, { Fragment, useEffect } from 'react';
9+
import { connect } from 'dva';
10+
11+
import Header from 'component/common/BasicHeader';
12+
import Footer from 'component/common/BasicFooter';
13+
import Banner from 'component/home/Banner';
14+
import Content from 'component/home/Content';
15+
import Join from 'component/home/Join';
16+
17+
const mock = [
18+
{
19+
id: 1,
20+
img: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
21+
name: '项目名称项目名称项目名称',
22+
description: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述',
23+
},
24+
{
25+
id: 2,
26+
img: '',
27+
name: '林峰',
28+
job: 'UI/UX资深设计师',
29+
description: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述',
30+
},
31+
{
32+
id: 3,
33+
img: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
34+
name: 'Alex Lee',
35+
job: 'UI/UX资深设计师',
36+
description: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述',
37+
},
38+
{
39+
id: 4,
40+
img: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
41+
name: 'Alex Lee',
42+
job: 'UI/UX资深设计师',
43+
description: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述',
44+
},
45+
{
46+
id: 5,
47+
img: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
48+
name: 'Alex Lee',
49+
job: 'UI/UX资深设计师',
50+
description: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述',
51+
},
52+
{
53+
id: 6,
54+
img: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
55+
name: 'Alex Lee',
56+
job: 'UI/UX资深设计师',
57+
description: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述',
58+
},
59+
{
60+
id: 7,
61+
img: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
62+
name: 'Alex Lee',
63+
job: 'UI/UX资深设计师',
64+
description: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述',
65+
},
66+
{
67+
id: 8,
68+
img: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
69+
name: 'Alex Lee',
70+
job: 'UI/UX资深设计师',
71+
description: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述',
72+
},
73+
{
74+
id: 9,
75+
img: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
76+
name: 'Alex Lee',
77+
job: 'UI/UX资深设计师',
78+
description: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述',
79+
},
80+
]
81+
82+
function Home({ currentUser, dispatch, ...props }) {
83+
useEffect(() => {
84+
dispatch({
85+
type: 'user/fetchCurrent',
86+
});
87+
}, [1]);
88+
return (
89+
<Fragment>
90+
<Header currentUser={currentUser} />
91+
<Banner />
92+
<Content
93+
type="project"
94+
title="优秀项目推荐"
95+
data={mock}
96+
/>
97+
<Content
98+
type="team"
99+
title="迅速加入团队"
100+
data={mock}
101+
/>
102+
<Content
103+
type="person"
104+
title="优秀人才"
105+
limit={8}
106+
data={mock}
107+
/>
108+
<Join />
109+
<Footer />
110+
</Fragment>
111+
);
112+
}
113+
114+
export default connect(({ user }) => ({ currentUser: user.currentUser }))(Home);

src/pages/index.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy