Permalink
Browse files

Step 3: Create '~/components/CardList.jsx' component and refactor 'St…

…aticMiniDashboard.jsx' to use it.
  • Loading branch information...
embengineering committed May 20, 2016
1 parent aeff430 commit 1e24b1a34bd76c82f757ff34aed8177070c0989b
Showing with 14 additions and 6 deletions.
  1. +12 −0 src/components/CardList.jsx
  2. +2 −6 src/components/StaticMiniDashboard.jsx
@@ -0,0 +1,12 @@
import React from 'react';
import Card from '../components/Card.jsx';
const CardList = ({cards}) => (
<div className="cards-wrapper">
{cards.map((card, index) => (
<Card key={index} className="card-item" {...card} />
))}
</div>
);
export default CardList;
@@ -1,18 +1,14 @@
import React from 'react';
import Card from '../components/Card.jsx';
import WelcomeCard from '../components/WelcomeCard.jsx';
import CardList from '../components/CardList.jsx';
export default ({ welcomeMsg, cards }) => (
<div className="mdl-layout__container">
<div className="mdl-layout">
<div className="mdl-layout mdl-color--grey-100">
<div className="dashboard-wrapper">
<WelcomeCard {...welcomeMsg} />
<div className="cards-wrapper">
{cards.map((card, index) => (
<Card key={index} className="card-item" {...card} />
))}
</div>
<CardList cards={cards} />
</div>
</div>
</div>

0 comments on commit 1e24b1a

Please sign in to comment.