From 55f15c9350cc531324e6182895f494eeb8174bc6 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 29 Apr 2019 09:13:59 +0900 Subject: Move to react --- src/settings/components/form/blacklist-form.jsx | 4 ++-- src/settings/components/form/keymaps-form.jsx | 4 ++-- src/settings/components/form/properties-form.jsx | 4 ++-- src/settings/components/form/search-form.jsx | 4 ++-- src/settings/components/index.jsx | 8 ++++---- src/settings/components/ui/add-button.jsx | 4 ++-- src/settings/components/ui/delete-button.jsx | 4 ++-- src/settings/components/ui/input.jsx | 4 ++-- src/settings/index.jsx | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/settings') 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