pass ctx props

This commit is contained in:
srgooglo 2022-06-02 00:36:31 +02:00
parent a3995eb988
commit 3a229d2874

View File

@ -10,8 +10,6 @@ import { Icons, createIconRender } from "components/Icons"
import SettingsList from "schemas/settings" import SettingsList from "schemas/settings"
import groupsDecorator from "schemas/settingsGroupsDecorator.json" import groupsDecorator from "schemas/settingsGroupsDecorator.json"
import { AboutApp } from ".."
import "./index.less" import "./index.less"
const ItemTypes = { const ItemTypes = {
@ -269,7 +267,13 @@ const SettingItem = (props) => {
</div> </div>
<div className="component"> <div className="component">
<div> <div>
{loading ? <div> Loading... </div> : React.createElement(SettingComponent, item.props)} {loading ? <div> Loading... </div> : React.createElement(SettingComponent, {
...item.props,
ctx: {
dispatchUpdate,
onUpdateItem,
}
})}
</div> </div>
{delayedValue && <div> {delayedValue && <div>
@ -381,7 +385,7 @@ export default class SettingsMenu extends React.PureComponent {
onClickAppAbout = () => { onClickAppAbout = () => {
window.app.setLocation("/about") window.app.setLocation("/about")
if (typeof this.props.close === "function") { if (typeof this.props.close === "function") {
this.props.close() this.props.close()
} }