diff --git a/README.md b/README.md index f993a93..8b889da 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,11 @@ - [x] 数据列表 - [ ] 数据列表交互动效 - [x] 表单相关 -- [ ] dashbord页面(部分完成) +- [ ] dashbord页面 + - [x] 数字卡片 + - [x] 数据曲线图 + - [x] 实时天气卡片 + - [x] 名言引用 - [ ] 可视化图表示例 ## 开发及构建 diff --git a/src/components/dashboard/weather.js b/src/components/dashboard/weather.js index 5fab98c..7ea81ac 100644 --- a/src/components/dashboard/weather.js +++ b/src/components/dashboard/weather.js @@ -9,7 +9,7 @@ function Weather(props) {
-

{name}

+

{name}

{temperature + '°'}

diff --git a/src/components/dashboard/weather.less b/src/components/dashboard/weather.less index c03a2ad..e07c6cf 100644 --- a/src/components/dashboard/weather.less +++ b/src/components/dashboard/weather.less @@ -6,11 +6,13 @@ padding: 24px; justify-content: space-between; display: flex; + font-size: 14px; .left { display: flex; flex-direction: column; - width: 50%; + width: 64px; + padding-top: 72px; .icon { width: 64px; @@ -18,17 +20,17 @@ background-position: center; background-size: cover; } - - .name {} } .right { display: flex; flex-direction: column; width: 50%; + .temperature { font-size: 36px; text-align: right; + height: 64px; } .description { diff --git a/src/routes/dashboard.js b/src/routes/dashboard.js index 0ed8612..bdcbd91 100644 --- a/src/routes/dashboard.js +++ b/src/routes/dashboard.js @@ -13,94 +13,123 @@ const numberCardData = [ { icon: 'dot-chart', color: color.green, - title:'Online Review', - number:2781 - }, - { + title: 'Online Review', + number: 2781 + }, { icon: 'pay-circle-o', color: color.blue, - title:'New Customers', - number:3241 - }, - { + title: 'New Customers', + number: 3241 + }, { icon: 'message', color: color.purple, - title:'Active Projects', - number:253 - }, - { + title: 'Active Projects', + number: 253 + }, { icon: 'paper-clip', color: color.red, - title:'Referrals', - number:4324 + title: 'Referrals', + number: 4324 } ] -const quoteProps={ - name:'Joho Doe', - title:'Graphic Designer', - content:`I'm selfish, impatient and a little insecure. I make mistakes, I am out of control and at times hard to handle. But if you can't handle me at my worst, then you sure as hell don't deserve me at my best.`, - avatar:'http://img.hb.aicdn.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236', +const quoteProps = { + name: 'Joho Doe', + title: 'Graphic Designer', + content: `I'm selfish, impatient and a little insecure. I make mistakes, I am out of control and at times hard to handle. But if you can't handle me at my worst, then you sure as hell don't deserve me at my best.`, + avatar: 'http://img.hb.aicdn.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236' } - - function Dashboard({dashboard}) { const {weather} = dashboard - const numberCards = numberCardData.map((item,key) => + const numberCards = numberCardData.map((item, key) => ) - return ( - {numberCards} - - - + return ( + + {numberCards} + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - )} + + + + + + + + + + + + + + + + + + + + + ) +} Dashboard.propTypes = { dashboard: PropTypes.object } -function mapStateToProps({ dashboard }) { - return { dashboard } +function mapStateToProps({dashboard}) { + return {dashboard} } export default connect(mapStateToProps)(Dashboard) - -// export default connect(({dashboard}) => ({dashboard}))(Dashboard)