import React from "react"; import { connect } from "react-redux"; import styled from "styled-components"; import TextArea from "./ui/TextArea"; import Radio from "./ui/Radio"; import SearchForm from "./form/SearchForm"; import KeymapsForm from "./form/KeymapsForm"; import BlacklistForm from "./form/BlacklistForm"; import PropertiesForm from "./form/PropertiesForm"; import PartialBlacklistForm from "./form/PartialBlacklistForm"; import * as settingActions from "../../settings/actions/setting"; import SettingData, { FormKeymaps, FormSearch, FormSettings, JSONTextSettings, } from "../../shared/SettingData"; import { State as AppState } from "../reducers/setting"; import Properties from "../../shared/settings/Properties"; import Blacklist from "../../shared/settings/Blacklist"; const Container = styled.form` padding: 2px; font-family: system-ui; `; const Fieldset = styled.fieldset` margin: 0; padding: 0; border: none; margin-top: 1rem; &:first-of-type { margin-top: 1rem; } `; const Legend = styled.legend` font-size: 1.5rem; padding: 0.5rem 0; font-weight: bold; `; const DO_YOU_WANT_TO_CONTINUE = "Some settings in JSON can be lost when migrating. " + "Do you want to continue?"; type StateProps = ReturnType; interface DispatchProps { dispatch: (action: any) => void; } type Props = StateProps & DispatchProps & { // FIXME store: any; }; class SettingsComponent extends React.Component { componentDidMount() { this.props.dispatch(settingActions.load()); } renderFormFields(form: FormSettings) { return (
Keybindings
Search Engines
Blacklist
Partial blacklist
Properties
); } renderJsonFields(json: JSONTextSettings, error: string) { return (