@@ -6,19 +6,7 @@ import { Trans, withI18n } from '@lingui/react'
66import { Color } from 'utils'
77import { Page , ScrollBar } from 'components'
88import ScanSVG from './components/covenantscan.svg'
9- import {
10- // NumberCard,
11- Quote ,
12- // Sales,
13- Weather ,
14- RecentSales ,
15- Comments ,
16- Completed ,
17- Browser ,
18- Cpu ,
19- User ,
20- } from './components_bck'
21- import { GetPTC , CreateProject , TaskList , Projects } from './components'
9+ import { User , GetPTC , CreateProject , TaskList , Projects } from './components'
2210import styles from './index.less'
2311
2412const bodyStyle = {
@@ -29,35 +17,16 @@ const bodyStyle = {
2917}
3018
3119@connect ( ( { app, dashboard, loading } ) => ( {
32- avatar : app . user . avatar ,
33- username : app . user . username ,
20+ user : app . user ,
3421 projects : app . projects ,
22+ mainwallet : app . mainwallet ,
3523 dashboard,
3624 loading,
3725} ) )
3826class Dashboard extends PureComponent {
39- state = {
40- show : false ,
41- }
4227 render ( ) {
43- const { avatar, username, dashboard, loading } = this . props
44- const {
45- tasks,
46- weather,
47- sales,
48- quote,
49- numbers,
50- recentSales,
51- comments,
52- completed,
53- browser,
54- cpu,
55- user,
56- } = dashboard
57-
58- const numberCards = numbers . map ( ( item , key ) => (
59- < Col key = { key } lg = { 6 } md = { 12 } />
60- ) )
28+ const { user, dashboard, loading } = this . props
29+ const { tasks } = dashboard
6130
6231 return (
6332 < Page className = { styles . dashboard } >
@@ -67,10 +36,7 @@ class Dashboard extends PureComponent {
6736 < Trans > Utilities</ Trans >
6837 </ div >
6938 < Col lg = { 6 } md = { 6 } >
70- < GetPTC
71- { ...weather }
72- loading = { loading . effects [ 'dashboard/queryWeather' ] }
73- />
39+ < GetPTC />
7440 </ Col >
7541 < Col lg = { 6 } md = { 6 } >
7642 < Card
@@ -114,6 +80,7 @@ class Dashboard extends PureComponent {
11480 < div className = { styles . sectionTitle } >
11581 < Trans > Tasks</ Trans >
11682 </ div >
83+
11784 < Col lg = { 16 } md = { 16 } sm = { 24 } >
11885 < Card
11986 title = "All Tasks"
@@ -125,81 +92,20 @@ class Dashboard extends PureComponent {
12592 < TaskList data = { tasks } />
12693 </ Card >
12794 </ Col >
128- </ Row >
129-
130- < div style = { { float : 'right' } } >
131- 备用
132- < Switch
133- size = "small"
134- onChange = { checked => {
135- this . setState ( { show : checked } )
136- } }
137- />
138- </ div >
13995
140- < div style = { { display : this . state . show ? 'inherit' : 'none' } } >
141- < Col lg = { 6 } md = { 24 } >
142- < Row gutter = { 24 } >
143- < Col lg = { 24 } md = { 12 } >
144- < Card
145- bordered = { false }
146- className = { styles . quote }
147- bodyStyle = { {
148- padding : 0 ,
149- height : 204 ,
150- background : Color . peach ,
151- } }
152- >
153- < ScrollBar >
154- < Quote { ...quote } />
155- </ ScrollBar >
156- </ Card >
157- </ Col >
158- </ Row >
159- </ Col >
160- < Col lg = { 12 } md = { 24 } >
161- < Card bordered = { false } { ...bodyStyle } >
162- < RecentSales data = { recentSales } />
163- </ Card >
164- </ Col >
165- < Col lg = { 12 } md = { 24 } >
166- < Card bordered = { false } { ...bodyStyle } >
167- < ScrollBar >
168- < Comments data = { comments } />
169- </ ScrollBar >
170- </ Card >
171- </ Col >
172- < Col lg = { 24 } md = { 24 } >
173- < Card
174- bordered = { false }
175- bodyStyle = { {
176- padding : '24px 36px 24px 0' ,
177- } }
178- >
179- < Completed data = { completed } />
180- </ Card >
181- </ Col >
182- < Col lg = { 8 } md = { 24 } >
183- < Card bordered = { false } { ...bodyStyle } >
184- < Browser data = { browser } />
185- </ Card >
186- </ Col >
187- < Col lg = { 8 } md = { 24 } >
188- < Card bordered = { false } { ...bodyStyle } >
189- < ScrollBar >
190- < Cpu { ...cpu } />
191- </ ScrollBar >
192- </ Card >
193- </ Col >
19496 < Col lg = { 8 } md = { 24 } >
19597 < Card
19698 bordered = { false }
19799 bodyStyle = { { ...bodyStyle . bodyStyle , padding : 0 } }
198100 >
199- < User { ...user } avatar = { avatar } username = { username } />
101+ < User
102+ { ...user }
103+ projectNum = { this . props . projects . length }
104+ ptc = { this . props . mainwallet . balance }
105+ />
200106 </ Card >
201107 </ Col >
202- </ div >
108+ </ Row >
203109 </ Row >
204110 </ Page >
205111 )
0 commit comments