From 6669f6b6ef2a3268dfeca87dbccc2ac8ef2fa30d Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 9 Oct 2017 13:42:16 +0900 Subject: use react in settings --- src/settings/components/index.jsx | 78 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 src/settings/components/index.jsx (limited to 'src/settings/components/index.jsx') diff --git a/src/settings/components/index.jsx b/src/settings/components/index.jsx new file mode 100644 index 0000000..e57b09d --- /dev/null +++ b/src/settings/components/index.jsx @@ -0,0 +1,78 @@ +import './site.scss'; +import React from 'react'; +import PropTypes from 'prop-types'; +import * as settingActions from 'settings/actions/setting'; +import { validate } from 'shared/validators/setting'; + +class SettingsComponent extends React.Component { + constructor(props, context) { + super(props, context); + + this.state = { + settings: { + json: '', + } + }; + this.context.store.subscribe(this.stateChanged.bind(this)); + } + + componentDidMount() { + this.context.store.dispatch(settingActions.load()); + } + + stateChanged() { + let settings = this.context.store.getState(); + this.setState({ settings }); + } + + render() { + return ( +
+

Configure Vim-Vixen

+ +
+ +