Skip to content

Commit

Permalink
built our first class component for the inputs container, and built a…
Browse files Browse the repository at this point in the history
…n input functional component to render custom inputs
  • Loading branch information
Maxnelson997 committed May 16, 2018
1 parent a18ea06 commit 2697dbf
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, { Component } from 'react';

import Input from './input';

class Card extends Component {
render() {
return (
<div className="card">
{ Input('Color') }
{ Input('Plural Noun') }
</div>
)
}
}

export default Card;
2 changes: 2 additions & 0 deletions src/components/home.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React, { Component } from 'react';

import Header from './header';
import Card from './card';

class Home extends Component {
render() {
return (
<div className="home">
{ Header() }
<Card />
</div>
);
}
Expand Down
12 changes: 12 additions & 0 deletions src/components/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';

const Input = (title) => {
return (
<div className="input">
<input />
<label>{title}</label>
</div>
)
}

export default Input;

0 comments on commit 2697dbf

Please sign in to comment.