From 91d4d5b5dac1be4289902867305cf2465b95970b Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Sat, 14 Jan 2017 12:55:42 -0700 Subject: [PATCH] Lots of different changes, mostly to convert to InfernoJS and to work on updating to Bulma structure. --- .babelrc | 3 +- package.json | 3 + src/components/Button.jsx | 7 +- src/components/Checkbox.jsx | 5 +- src/components/Dictionary.jsx | 9 ++- src/components/Dropdown.jsx | 17 +++-- src/components/EditDictionaryForm.jsx | 7 +- src/components/EditWordForm.jsx | 7 +- src/components/FixedPage.jsx | 7 +- src/components/Footer.jsx | 7 +- src/components/Header.jsx | 39 ++++++---- src/components/InfoDisplay.jsx | 7 +- src/components/Input.jsx | 73 +++++++++++++----- src/components/TextArea.jsx | 47 +++++++++--- src/components/Word.jsx | 34 +++++---- src/components/WordForm.jsx | 22 +++--- src/index.jsx | 103 +++++++++++++++++--------- src/js/IDManager.js | 13 ++++ src/sass/main.scss | 6 +- webpack.config.js | 4 +- 20 files changed, 289 insertions(+), 131 deletions(-) create mode 100644 src/js/IDManager.js diff --git a/.babelrc b/.babelrc index 6763fb5..57d1d41 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,4 @@ { - "presets": [ "es2015", "react" ] + "presets": [ "es2015" ], + "plugins": [ "inferno" ] } \ No newline at end of file diff --git a/package.json b/package.json index 0d470f4..a28c709 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,8 @@ "dependencies": { "babel-polyfill": "^6.13.0", "bulma": "^0.2.3", + "inferno": "^1.0.3", + "inferno-component": "^1.0.3", "json-query": "^2.2.0", "marked": "^0.3.6", "papaparse": "^4.1.2", @@ -33,6 +35,7 @@ "devDependencies": { "babel-core": "^6.14.0", "babel-loader": "^6.2.5", + "babel-plugin-inferno": "^1.4.0", "babel-preset-es2015": "^6.14.0", "babel-preset-react": "^6.11.1", "css-loader": "^0.25.0", diff --git a/src/components/Button.jsx b/src/components/Button.jsx index ae3b583..8284f4e 100644 --- a/src/components/Button.jsx +++ b/src/components/Button.jsx @@ -1,7 +1,10 @@ -import React from 'react'; +// import React from 'react'; +import Inferno from 'inferno'; +import Component from 'inferno-component'; // Creates a clickable tag with an onclick action. -export class Button extends React.Component { +// export class Button extends React.Component { +export class Button extends Component { constructor(props) { super(props); } diff --git a/src/components/Checkbox.jsx b/src/components/Checkbox.jsx index c1d16c8..4fb14e4 100644 --- a/src/components/Checkbox.jsx +++ b/src/components/Checkbox.jsx @@ -1,4 +1,5 @@ -import React from 'react'; +// import React from 'react'; +import Inferno from 'inferno'; import {Input} from './Input'; export class Checkbox extends Input { @@ -25,7 +26,7 @@ export class Checkbox extends Input { {this.props.name} {this.showHelperLink()} - + ); } diff --git a/src/components/Dictionary.jsx b/src/components/Dictionary.jsx index b297a7b..b55258b 100644 --- a/src/components/Dictionary.jsx +++ b/src/components/Dictionary.jsx @@ -1,9 +1,12 @@ -import React from 'react'; +// import React from 'react'; +import Inferno from 'inferno'; +import Component from 'inferno-component'; import {Word} from './Word'; // A component for showing just the list of words provided to it as a prop. -export class Dictionary extends React.Component { +// export class Dictionary extends React.Component { +export class Dictionary extends Component { constructor(props) { super(props); } @@ -33,7 +36,7 @@ export class Dictionary extends React.Component { render() { return ( -
+
{this.showWords()}
); diff --git a/src/components/Dropdown.jsx b/src/components/Dropdown.jsx index 11fb24c..f6ce890 100644 --- a/src/components/Dropdown.jsx +++ b/src/components/Dropdown.jsx @@ -1,4 +1,5 @@ -import React from 'react'; +// import React from 'react'; +import Inferno from 'inferno'; import {Input} from './Input'; import {htmlEntities} from '../js/helpers'; @@ -39,11 +40,15 @@ export class Dropdown extends Input { render() { return ( -