Skip to content

Commit a55e744

Browse files
committed
3.4 exercise
1 parent 6d967e3 commit a55e744

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

.learn/resets/03.4-jumbotron/app.jsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from "react";
2+
import ReactDOM from "react-dom";
3+
import PropTypes from "prop-types";
4+
5+
const Jumbotron = props => {
6+
//here you have to return expected html using the properties being passed to the component
7+
};
8+
9+
Jumbotron.propTypes = {
10+
//proptypes here
11+
title: PropTypes.string,
12+
13+
};
14+
15+
ReactDOM.render(
16+
<Jumbotron
17+
title="Welcome to react"
18+
description="React is the most popular rendering library in the world"
19+
buttonLabel="Go to the official website"
20+
buttonURL="https://reactjs.org/"
21+
/>,
22+
23+
document.querySelector("#myDiv")
24+
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from "react";
2+
import ReactDOM from "react-dom";
3+
import PropTypes from "prop-types";
4+
5+
/**
6+
* here you have declare your Alert component and return
7+
* the html that bootstrap dictates for its alert component
8+
*/
9+
10+
11+
// here is where the alert component is being used, you don't have to edit this part,
12+
// but it helps you understan what properties is the component using
13+
ReactDOM.render(<Alert text="OMG! Something really bad has happended!" />, document.querySelector("#myDiv"));

exercises/03.4-jumbotron/app.jsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,25 @@ import React from "react";
22
import ReactDOM from "react-dom";
33
import PropTypes from "prop-types";
44

5-
const Jumbotron = props => {
5+
const Jumbotron = (props) => {
66
//here you have to return expected html using the properties being passed to the component
7+
8+
return (<div className="jumbotron m-5">
9+
<h1 className="display-4">{props.title}</h1>
10+
<p className="lead">{props.description}</p>
11+
<a className="btn btn-primary btn-lg" href={props.buttonURL} role="button">
12+
{props.buttonLabel}
13+
</a>
14+
</div>
15+
)
716
};
817

918
Jumbotron.propTypes = {
1019
//proptypes here
1120
title: PropTypes.string,
12-
21+
description: PropTypes.string,
22+
buttonLabel: PropTypes.string,
23+
buttonURL: PropTypes.string,
1324
};
1425

1526
ReactDOM.render(

0 commit comments

Comments
 (0)