From f60a7e845da88722b02440716bfa82b28dcf3660 Mon Sep 17 00:00:00 2001 From: catarak Date: Mon, 27 Jun 2016 15:57:36 -0400 Subject: [PATCH] add prop types to preference, fix proptype head in preview frame --- client/modules/IDE/components/Preferences.js | 60 ++++++++++--------- client/modules/IDE/components/PreviewFrame.js | 2 +- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/client/modules/IDE/components/Preferences.js b/client/modules/IDE/components/Preferences.js index 89e0bb89..fb4bdffd 100644 --- a/client/modules/IDE/components/Preferences.js +++ b/client/modules/IDE/components/Preferences.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { PropTypes } from 'react'; const Isvg = require('react-inlinesvg'); const exitUrl = require('../../../images/exit.svg'); @@ -6,33 +6,39 @@ const plusUrl = require('../../../images/plus.svg'); const minusUrl = require('../../../images/minus.svg'); const classNames = require('classnames'); -class Preferences extends React.Component { - render() { - const preferencesContainerClass = classNames({ - preferences: true, - 'preferences--selected': this.props.isVisible - }); - return ( -
-
-

Preferences

- -
-
-

Text Size

- -

{this.props.fontSize}

- -
+function Preferences(props) { + const preferencesContainerClass = classNames({ + preferences: true, + 'preferences--selected': props.isVisible + }); + return ( +
+
+

Preferences

+
- ); - } +
+

Text Size

+ +

{props.fontSize}

+ +
+
+ ); } +Preferences.propTypes = { + isVisible: PropTypes.bool.isRequired, + closePreferences: PropTypes.func.isRequired, + decreaseFont: PropTypes.func.isRequired, + fontSize: PropTypes.number.isRequired, + increaseFont: PropTypes.func.isRequired +}; + export default Preferences; diff --git a/client/modules/IDE/components/PreviewFrame.js b/client/modules/IDE/components/PreviewFrame.js index 20c79907..fe53540a 100644 --- a/client/modules/IDE/components/PreviewFrame.js +++ b/client/modules/IDE/components/PreviewFrame.js @@ -69,7 +69,7 @@ class PreviewFrame extends React.Component { PreviewFrame.propTypes = { isPlaying: PropTypes.bool.isRequired, - head: PropTypes.string.isRequired, + head: PropTypes.object.isRequired, content: PropTypes.string.isRequired };