From 3a229d287420685a9fcff8399b91833be7f26fb3 Mon Sep 17 00:00:00 2001 From: srgooglo Date: Thu, 2 Jun 2022 00:36:31 +0200 Subject: [PATCH] pass ctx props --- packages/app/src/components/Settings/index.jsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/app/src/components/Settings/index.jsx b/packages/app/src/components/Settings/index.jsx index 81a35695..91a147d3 100644 --- a/packages/app/src/components/Settings/index.jsx +++ b/packages/app/src/components/Settings/index.jsx @@ -10,8 +10,6 @@ import { Icons, createIconRender } from "components/Icons" import SettingsList from "schemas/settings" import groupsDecorator from "schemas/settingsGroupsDecorator.json" -import { AboutApp } from ".." - import "./index.less" const ItemTypes = { @@ -269,7 +267,13 @@ const SettingItem = (props) => {
- {loading ?
Loading...
: React.createElement(SettingComponent, item.props)} + {loading ?
Loading...
: React.createElement(SettingComponent, { + ...item.props, + ctx: { + dispatchUpdate, + onUpdateItem, + } + })}
{delayedValue &&
@@ -381,7 +385,7 @@ export default class SettingsMenu extends React.PureComponent { onClickAppAbout = () => { window.app.setLocation("/about") - + if (typeof this.props.close === "function") { this.props.close() }