aboutsummaryrefslogtreecommitdiff
path: root/src/settings
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-04-29 09:13:59 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-04-29 09:13:59 +0900
commit55f15c9350cc531324e6182895f494eeb8174bc6 (patch)
treef7fc53993ba3c0b44717072599d1cb14a2faaceb /src/settings
parent8773a4ec2891f1ec7bdaf5453eb522ab697606ef (diff)
Move to react
Diffstat (limited to 'src/settings')
-rw-r--r--src/settings/components/form/blacklist-form.jsx4
-rw-r--r--src/settings/components/form/keymaps-form.jsx4
-rw-r--r--src/settings/components/form/properties-form.jsx4
-rw-r--r--src/settings/components/form/search-form.jsx4
-rw-r--r--src/settings/components/index.jsx8
-rw-r--r--src/settings/components/ui/add-button.jsx4
-rw-r--r--src/settings/components/ui/delete-button.jsx4
-rw-r--r--src/settings/components/ui/input.jsx4
-rw-r--r--src/settings/index.jsx4
9 files changed, 20 insertions, 20 deletions
diff --git a/src/settings/components/form/blacklist-form.jsx b/src/settings/components/form/blacklist-form.jsx
index 7ae9652..492c3af 100644
--- a/src/settings/components/form/blacklist-form.jsx
+++ b/src/settings/components/form/blacklist-form.jsx
@@ -1,9 +1,9 @@
import './blacklist-form.scss';
import AddButton from '../ui/add-button';
import DeleteButton from '../ui/delete-button';
-import { h, Component } from 'preact';
+import React from 'react';
-class BlacklistForm extends Component {
+class BlacklistForm extends React.Component {
render() {
let value = this.props.value;
diff --git a/src/settings/components/form/keymaps-form.jsx b/src/settings/components/form/keymaps-form.jsx
index ca51c96..8c0a83f 100644
--- a/src/settings/components/form/keymaps-form.jsx
+++ b/src/settings/components/form/keymaps-form.jsx
@@ -1,5 +1,5 @@
import './keymaps-form.scss';
-import { h, Component } from 'preact';
+import React from 'react';
import Input from '../ui/input';
const KeyMapFields = [
@@ -72,7 +72,7 @@ const KeyMapFields = [
const AllowdOps = [].concat(...KeyMapFields.map(group => group.map(e => e[0])));
-class KeymapsForm extends Component {
+class KeymapsForm extends React.Component {
render() {
let values = this.props.value;
diff --git a/src/settings/components/form/properties-form.jsx b/src/settings/components/form/properties-form.jsx
index ceb79d7..7d591d5 100644
--- a/src/settings/components/form/properties-form.jsx
+++ b/src/settings/components/form/properties-form.jsx
@@ -1,7 +1,7 @@
import './properties-form.scss';
-import { h, Component } from 'preact';
+import React from 'react';
-class PropertiesForm extends Component {
+class PropertiesForm extends React.Component {
render() {
let types = this.props.types;
diff --git a/src/settings/components/form/search-form.jsx b/src/settings/components/form/search-form.jsx
index 2d5f01b..81204f3 100644
--- a/src/settings/components/form/search-form.jsx
+++ b/src/settings/components/form/search-form.jsx
@@ -1,9 +1,9 @@
import './search-form.scss';
-import { h, Component } from 'preact';
+import React from 'react';
import AddButton from '../ui/add-button';
import DeleteButton from '../ui/delete-button';
-class SearchForm extends Component {
+class SearchForm extends React.Component {
render() {
let value = this.props.value;
diff --git a/src/settings/components/index.jsx b/src/settings/components/index.jsx
index 9633359..9dae25e 100644
--- a/src/settings/components/index.jsx
+++ b/src/settings/components/index.jsx
@@ -1,6 +1,6 @@
import './site.scss';
-import { h, Component } from 'preact';
-import { connect } from 'preact-redux';
+import React from 'react';
+import { connect } from 'react-redux';
import Input from './ui/input';
import SearchForm from './form/search-form';
import KeymapsForm from './form/keymaps-form';
@@ -13,7 +13,7 @@ const DO_YOU_WANT_TO_CONTINUE =
'Some settings in JSON can be lost when migrating. ' +
'Do you want to continue?';
-class SettingsComponent extends Component {
+class SettingsComponent extends React.Component {
componentDidMount() {
this.props.dispatch(settingActions.load());
}
@@ -136,7 +136,7 @@ class SettingsComponent extends Component {
this.props.dispatch(settingActions.switchToForm(this.props.json));
}
- let settings = this.context.store.getState();
+ let settings = this.props.getState();
this.props.dispatch(settingActions.save(settings));
}
}
diff --git a/src/settings/components/ui/add-button.jsx b/src/settings/components/ui/add-button.jsx
index 79292d8..031d28b 100644
--- a/src/settings/components/ui/add-button.jsx
+++ b/src/settings/components/ui/add-button.jsx
@@ -1,7 +1,7 @@
import './add-button.scss';
-import { h, Component } from 'preact';
+import React from 'react';
-class AddButton extends Component {
+class AddButton extends React.Component {
render() {
return <input
className='ui-add-button' type='button' value='&#x271a;'
diff --git a/src/settings/components/ui/delete-button.jsx b/src/settings/components/ui/delete-button.jsx
index 8077a76..3dfe14a 100644
--- a/src/settings/components/ui/delete-button.jsx
+++ b/src/settings/components/ui/delete-button.jsx
@@ -1,7 +1,7 @@
import './delete-button.scss';
-import { h, Component } from 'preact';
+import React from 'react';
-class DeleteButton extends Component {
+class DeleteButton extends React.Component {
render() {
return <input
className='ui-delete-button' type='button' value='&#x2716;'
diff --git a/src/settings/components/ui/input.jsx b/src/settings/components/ui/input.jsx
index e99dbc7..2f42b62 100644
--- a/src/settings/components/ui/input.jsx
+++ b/src/settings/components/ui/input.jsx
@@ -1,7 +1,7 @@
-import { h, Component } from 'preact';
+import React from 'react';
import './input.scss';
-class Input extends Component {
+class Input extends React.Component {
renderText(props) {
let inputClassName = props.error ? 'input-error' : '';
diff --git a/src/settings/index.jsx b/src/settings/index.jsx
index 8097d31..9df1073 100644
--- a/src/settings/index.jsx
+++ b/src/settings/index.jsx
@@ -1,7 +1,7 @@
-import { h, render } from 'preact';
+import { render } from 'react';
import SettingsComponent from './components';
import reducer from './reducers/setting';
-import { Provider } from 'preact-redux';
+import { Provider } from 'react-redux';
import promise from 'redux-promise';
import { createStore, applyMiddleware } from 'redux';