import React from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import { createSubscribedElement } from '../../UnstatedUtils'; import AppContainer from '../../../services/AppContainer'; class SecurityLocalSetting extends React.Component { constructor(props) { super(); this.state = { isLocalEnabled: true, // TODO show selected value at here modeValue: 'open', }; this.switchIsLocalEnabled = this.switchIsLocalEnabled.bind(this); } switchIsLocalEnabled() { console.log('hogehoge'); this.setState({ isLocalEnabled: !this.state.isLocalEnabled }); } render() { const { t } = this.props; return (

{ t('security_setting.Local.name') } { t('security_setting.configuration') }

{/* TODO show or hide */}

{ t('security_setting.Local.note for the only env option', 'LOCAL_STRATEGY_USES_ONLY_ENV_VARS_FOR_SOME_OPTIONS') }

{ this.switchIsLocalEnabled() }} />
{this.state.isLocalEnabled && (
{/* TODO adjust dropdown after BS4 */}

{ t('security_setting.Register limitation desc') }

)} {/* TODO replace component */}
); } } SecurityLocalSetting.propTypes = { t: PropTypes.func.isRequired, // i18next appContainer: PropTypes.instanceOf(AppContainer).isRequired, }; const SecurityLocalSettingWrapper = (props) => { return createSubscribedElement(SecurityLocalSetting, props, [AppContainer]); }; export default withTranslation()(SecurityLocalSettingWrapper);