diff --git a/src/components/Cases/Title.js b/src/components/Cases/Title.js
index 97cabf4..157c101 100644
--- a/src/components/Cases/Title.js
+++ b/src/components/Cases/Title.js
@@ -3,12 +3,10 @@
import React from "react";
import PropTypes from "prop-types";
-export default class CasesPageTitle extends React.Component {
- render() {
- return
{this.props.stationName}
;
- }
-}
+const CasesPageTitle = props => {props.stationName}
;
CasesPageTitle.propTypes = {
stationName: PropTypes.string
};
+
+export default CasesPageTitle;
diff --git a/src/components/Pages/AddNew/AddNewBanner.js b/src/components/Pages/AddNew/AddNewBanner.js
index 0d0e8a2..cd84041 100644
--- a/src/components/Pages/AddNew/AddNewBanner.js
+++ b/src/components/Pages/AddNew/AddNewBanner.js
@@ -17,18 +17,16 @@ const StyledCase = styled.div`
border: none;
`;
-export default class AddNewBanner extends React.Component {
- render() {
- return (
-
- Add New
-
- );
- }
-}
+const AddNewBanner = props => (
+
+ Add New
+
+);
AddNewBanner.propTypes = {
exam: PropTypes.string,
station: PropTypes.string,
submitStation: PropTypes.func
};
+
+export default AddNewBanner;
diff --git a/src/components/Pages/AddNew/AddNewTile.js b/src/components/Pages/AddNew/AddNewTile.js
index a259a11..2b532be 100644
--- a/src/components/Pages/AddNew/AddNewTile.js
+++ b/src/components/Pages/AddNew/AddNewTile.js
@@ -3,12 +3,10 @@
import React from "react";
import { Link } from "react-router-dom";
-export default class AddNewTile extends React.Component {
- render() {
- return (
-
- Add New
-
- );
- }
-}
+const AddNewTile = () => (
+
+ Add New
+
+);
+
+export default AddNewTile;
diff --git a/src/components/Pages/AddNew/InstructionText.js b/src/components/Pages/AddNew/InstructionText.js
index 82b1caa..b5ef3af 100644
--- a/src/components/Pages/AddNew/InstructionText.js
+++ b/src/components/Pages/AddNew/InstructionText.js
@@ -8,16 +8,12 @@ const StyledInstructionH2 = styled.h2`
margin: 0 16px 16px 16px;
`;
-export default class InstructionText extends React.Component {
- render() {
- return (
-
- {this.props.text}
-
- );
- }
-}
+const InstructionText = props => (
+ {props.text}
+);
InstructionText.propTypes = {
text: PropTypes.string
};
+
+export default InstructionText;
diff --git a/src/components/Pages/AddNew/NewTileInput.js b/src/components/Pages/AddNew/NewTileInput.js
index 501c36b..9dcc7e5 100644
--- a/src/components/Pages/AddNew/NewTileInput.js
+++ b/src/components/Pages/AddNew/NewTileInput.js
@@ -10,20 +10,18 @@ const StyledNewTileInputContainer = styled.div`
margin-top: 100px;
`;
-export default class NewTileInput extends React.Component {
- render() {
- return (
-
-
-
-
-
-
- );
- }
-}
+const NewTileInput = props => (
+
+
+
+
+
+
+);
NewTileInput.propTypes = {
instructionText: PropTypes.string,
userTypes: PropTypes.func
};
+
+export default NewTileInput;
diff --git a/src/components/Pages/ComingSoon.js b/src/components/Pages/ComingSoon.js
index 79f062f..80122ac 100644
--- a/src/components/Pages/ComingSoon.js
+++ b/src/components/Pages/ComingSoon.js
@@ -19,15 +19,13 @@ const ComingSoonImg = styled.img`
max-height: 100%;
`;
-export default class ComingSoon extends React.Component {
- render() {
- return (
-
-
-
-
-
-
- );
- }
-}
+const ComingSoon = () => (
+
+
+
+
+
+
+);
+
+export default ComingSoon;
diff --git a/src/components/Pages/Revision/RevisionPage.js b/src/components/Pages/Revision/RevisionPage.js
index de1d0c2..1170e05 100644
--- a/src/components/Pages/Revision/RevisionPage.js
+++ b/src/components/Pages/Revision/RevisionPage.js
@@ -75,21 +75,15 @@ export default class RevisionPage extends React.Component {
id="revision"
markComplete={this.markComplete}
swipe={this.swipe}
- caseTitle={this.state.caseTitle}
- caseDetails={this.state.caseDetails}
- caseDetailsDisplayed={this.state.caseDetailsDisplayed}
- markSchemeElements={this.state.markSchemeElements}
- markSchemeCompleted={this.state.markSchemeCompleted}
+ {...this.state}
/>
);
const resultsContainer = (
);
const { exam, station } = this.props.match.params;
@@ -98,11 +92,9 @@ export default class RevisionPage extends React.Component {
{this.state.resultsDisplayed ? resultsContainer : revisionContainer}
diff --git a/src/components/Pages/Revision/RevisionTitle.js b/src/components/Pages/Revision/RevisionTitle.js
index a144cef..8266958 100644
--- a/src/components/Pages/Revision/RevisionTitle.js
+++ b/src/components/Pages/Revision/RevisionTitle.js
@@ -3,12 +3,10 @@
import React from "react";
import PropTypes from "prop-types";
-export default class RevisionTitle extends React.Component {
- render() {
- return {this.props.caseTitle}
;
- }
-}
+const RevisionTitle = props => {props.caseTitle}
;
RevisionTitle.propTypes = {
caseTitle: PropTypes.string
};
+
+export default RevisionTitle;
diff --git a/src/components/Pages/Statistics.js b/src/components/Pages/Statistics.js
index 89dd5b3..bd11215 100644
--- a/src/components/Pages/Statistics.js
+++ b/src/components/Pages/Statistics.js
@@ -1,14 +1,11 @@
/* eslint-disable class-methods-use-this */
import React from "react";
-import Navbar from "../Navbar/Navbar";
import ComingSoon from "../Pages/ComingSoon";
-export default class StatisticsPage extends React.Component {
- render() {
- return (
-
-
-
- );
- }
-}
+const StatisticsPage = () => (
+
+
+
+);
+
+export default StatisticsPage;
diff --git a/src/components/TopBar/BackButton.js b/src/components/TopBar/BackButton.js
index 3830608..0911ee6 100644
--- a/src/components/TopBar/BackButton.js
+++ b/src/components/TopBar/BackButton.js
@@ -17,17 +17,13 @@ const StyledImg = styled.img`
height: 20px;
`;
-export default class BackButton extends React.Component {
- render() {
- return (
-
-
-
-
-
- );
- }
-}
+const BackButton = ({ link }) => (
+
+
+
+
+
+);
BackButton.propTypes = {
link: PropTypes.string
@@ -36,3 +32,5 @@ BackButton.propTypes = {
BackButton.contextTypes = {
router: PropTypes.object
};
+
+export default BackButton;
diff --git a/src/components/TopBar/TopBar.js b/src/components/TopBar/TopBar.js
index 7437dd7..0e225fd 100644
--- a/src/components/TopBar/TopBar.js
+++ b/src/components/TopBar/TopBar.js
@@ -51,11 +51,9 @@ export default class TopBar extends React.Component {
)}
{this.props.tickDisplayed && (
)}