From 44459e39c3526673ac2ac7065c5659e4af5ea7d8 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 18 Nov 2017 22:02:44 +0900 Subject: use preact --- src/settings/components/index.jsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/settings/components') diff --git a/src/settings/components/index.jsx b/src/settings/components/index.jsx index 4418942..bb2045a 100644 --- a/src/settings/components/index.jsx +++ b/src/settings/components/index.jsx @@ -1,10 +1,9 @@ import './site.scss'; -import React from 'react'; -import PropTypes from 'prop-types'; +import { h, Component } from 'preact'; import * as settingActions from 'settings/actions/setting'; import * as validator from 'shared/validators/setting'; -class SettingsComponent extends React.Component { +class SettingsComponent extends Component { constructor(props, context) { super(props, context); @@ -84,8 +83,4 @@ class SettingsComponent extends React.Component { } } -SettingsComponent.contextTypes = { - store: PropTypes.any, -}; - export default SettingsComponent; -- cgit v1.2.3 From d33b37cdb9d2956f5f2d23ab4e71e35db137b16e Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 19 Nov 2017 08:23:51 +0900 Subject: Use Preact for settings and show validation --- src/settings/components/index.jsx | 48 ++++++++++++++++++++------------- src/settings/components/site.scss | 2 ++ src/settings/components/ui/input.jsx | 50 +++++++++++++++++++++++++++++++++++ src/settings/components/ui/input.scss | 17 ++++++++++++ 4 files changed, 99 insertions(+), 18 deletions(-) create mode 100644 src/settings/components/ui/input.jsx create mode 100644 src/settings/components/ui/input.scss (limited to 'src/settings/components') diff --git a/src/settings/components/index.jsx b/src/settings/components/index.jsx index bb2045a..98d8fb2 100644 --- a/src/settings/components/index.jsx +++ b/src/settings/components/index.jsx @@ -1,5 +1,6 @@ import './site.scss'; import { h, Component } from 'preact'; +import Input from './ui/input'; import * as settingActions from 'settings/actions/setting'; import * as validator from 'shared/validators/setting'; @@ -10,6 +11,9 @@ class SettingsComponent extends Component { this.state = { settings: { json: '', + }, + errors: { + json: '', } }; this.context.store.subscribe(this.stateChanged.bind(this)); @@ -35,39 +39,47 @@ class SettingsComponent extends Component {

Configure Vim-Vixen

-

Load settings from:

- - + label='Use plain JSON' + checked={this.state.settings.source === 'json'} + value='json' /> -