Skip to content

Commit

Permalink
built our first functional component
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxnelson997 committed May 16, 2018
1 parent 3953d53 commit a18ea06
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';
import ReactDOM from 'react-dom';

import App from './components/app';
import Home from './components/home';

import 'bootstrap/dist/css/bootstrap.css';
// import 'bootstrap/dist/css/bootstrap.css';
import './style/main.scss';

function main() {
ReactDOM.render(
<App />
<Home />
, document.querySelector('.app-wrapper'));
}

Expand Down
12 changes: 0 additions & 12 deletions src/components/app.js

This file was deleted.

12 changes: 12 additions & 0 deletions src/components/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';

const Header = () => {
return (
<div className="header">
<h1>Bottega Madlibs</h1>
<p>Fill out the fields below and click the generate button to see the Mad Lib story.</p>
</div>
)
}

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

import Header from './header';

class Home extends Component {
render() {
return (
<div className="home">
{ Header() }
</div>
);
}
}

export default Home;

0 comments on commit a18ea06

Please sign in to comment.