diff --git a/package-lock.json b/package-lock.json index a0b2a76..eb62066 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2815,11 +2815,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2832,15 +2834,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2943,7 +2948,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2953,6 +2959,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2965,17 +2972,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -2992,6 +3002,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3064,7 +3075,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3074,6 +3086,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -3179,6 +3192,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6820,11 +6834,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6837,15 +6853,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -6948,7 +6967,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -6958,6 +6978,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6970,17 +6991,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -6997,6 +7021,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -7069,7 +7094,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -7079,6 +7105,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -7184,6 +7211,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/src/Question1-Header.js b/src/Question1-Header.js index 1527b3b..9ab04a0 100644 --- a/src/Question1-Header.js +++ b/src/Question1-Header.js @@ -1,4 +1,4 @@ -/* DELETE THIS LINE AND WRITE THE ANSWER TO QUESTION 1 HERE */ +import React from "react"; /* * ============= Question 1 ============= diff --git a/src/Question2-LionsExhibit.js b/src/Question2-LionsExhibit.js index b31af8c..7c01732 100644 --- a/src/Question2-LionsExhibit.js +++ b/src/Question2-LionsExhibit.js @@ -10,6 +10,15 @@ import React from "react"; -const LionsExhibit = () => null; +const LionsExhibit = () => { + return( +
+
+

Lions

+

The mane is the most recognisable feature of the species

+
+
+ ) +}; export default LionsExhibit; diff --git a/src/Question3-TigersExhibit.js b/src/Question3-TigersExhibit.js index ccfd252..a01dcd3 100644 --- a/src/Question3-TigersExhibit.js +++ b/src/Question3-TigersExhibit.js @@ -18,12 +18,18 @@ import React from "react"; -function TigersExhibit() { +function TigersExhibit(props) { return (

Tigers

-

There are ... tigers in the world

- +

There are {props.population} tigers in the world

+
); } diff --git a/src/Question4-MonkeysExhibit.js b/src/Question4-MonkeysExhibit.js index bfefca0..19d3191 100644 --- a/src/Question4-MonkeysExhibit.js +++ b/src/Question4-MonkeysExhibit.js @@ -4,19 +4,22 @@ * Convert the MonkeysExhibit component below to a class component. */ -import React from "react"; +import React, { Component } from "react"; +class MonkeysExhibit extends Component{ -function MonkeysExhibit(props) { - return ( -
-

Latin name: {props.latinName}

- + render(){ + return ( +
+

Latin name: {this.props.latinName}

+
- ); -} - -export default MonkeysExhibit; + ); + } + } + + export default MonkeysExhibit; + \ No newline at end of file diff --git a/src/Question5-AnimalSpotter.js b/src/Question5-AnimalSpotter.js index b7136a2..cc984dc 100644 --- a/src/Question5-AnimalSpotter.js +++ b/src/Question5-AnimalSpotter.js @@ -13,9 +13,17 @@ import React, { Component } from "react"; class AnimalSpotter extends Component { constructor(props) { super(props); - this.state = {}; + this.state = { + animalSpotted: 0 + }; } + spotAnimal = () => { + this.setState({ + animalSpotted: this.state.animalSpotted++ + }) + } + render() { return (
@@ -26,11 +34,15 @@ class AnimalSpotter extends Component { } } + + function CounterButton(props) { return ( - +
+ +
); }