import React from 'react' import * as antd from 'antd' import * as app from 'app' import * as Icons from 'components/Icons' import Icon from '@ant-design/icons' import { Post_Options } from 'globals/post_options.js' import styles from './post_options.less' export const optionBox = { toogle: () => { window.postoptions_box_class.handleToggleToolbox() return true }, get: () => { return window.postoptions_box_class.state.options_repo }, } export default class Post_options extends React.Component { constructor(props) { super(props), window.postoptions_box_class = this, this.state = { options_repo: Post_Options, options_box: false, } } onChangeOption(checked, id) { app.yconsole.log(`${id} to ${checked}`) } handleToggleToolbox = () => { this.setState({ options_box: !this.state.options_box }) } onChangeSwitch(item) { try { const to = !item.value const updatedValue = [...this.state.options_repo].map(ita => ita === item ? Object.assign(ita, { value: to }) : ita ) this.setState({ options_repo: updatedValue, forSave: true }) app.yconsole.log(`Changing ${item.key} to value ${to}`) } catch (err) { console.log(err) } } require(i) { if (i) { try { switch (i) { case 'pro': return app.IsThisUser.pro() ? false : true case 'dev': return app.IsThisUser.dev() ? false : true default: break } } catch (err) { app.notify.error(err) return false } } return false } rendersets = item => { let e = item.type switch (e) { case 'switch': return ( this.onChangeSwitch(item)} /> ) default: break } } renderSettings = () => { return ( (
{item.icon}
{this.require(item.require) ? `You need ${item.require}` : this.rendersets(item)}
)} /> ) } render() { return (

Post Options


Share Options

{this.renderSettings()}

Add some Extra

} disabled={true} type="primary" > {' '} Insert an Poll{' '} } disabled={true} type="primary" > {' '} Insert an Background{' '}
) } }