mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-25 09:52:19 +01:00
propagating self props by default
This commit is contained in:
parent
45e0052538
commit
7cbd001efc
5 changed files with 6 additions and 9 deletions
|
|
@ -5,7 +5,7 @@ import ls from './Menu.less';
|
|||
import AuxWidget from "./AuxWidget";
|
||||
import cx from 'classnames';
|
||||
|
||||
export default function Menu({children, x, y, orientationUp, centered, ...props}) {
|
||||
export default function Menu({children, x, y, orientationUp, centered, menuId, ...props}) {
|
||||
return <AuxWidget
|
||||
className={cx(ls.root, 'disable-selection')}
|
||||
zIndex={500}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export default function connect(WrappedComponent, tokens, config) {
|
|||
return dispatch;
|
||||
};
|
||||
|
||||
mapSelfProps = mapSelfProps || (() => undefined);
|
||||
mapSelfProps = PROPAGATE_SELF_PROPS;
|
||||
|
||||
return class StateConnector extends React.PureComponent {
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,5 @@ export default connect(BrepDebuggerWindow, BREP_DEBUG_WINDOW_VISIBLE, {
|
|||
mapProps: ([visible]) => ({visible}),
|
||||
mapActions: ({dispatch}) => ({
|
||||
close: () => dispatch(BREP_DEBUG_WINDOW_VISIBLE, false)
|
||||
}),
|
||||
mapSelfProps: PROPAGATE_SELF_PROPS
|
||||
})
|
||||
});
|
||||
|
|
@ -20,8 +20,7 @@ export default connect(HistoryWizard, CRAFT_TOKENS.MODIFICATIONS, {
|
|||
mapActions: ({updateState}) => ({
|
||||
step: (params) => updateState(CRAFT_TOKENS.MODIFICATIONS, modifications => stepOverridingParams(modifications, params)),
|
||||
cancel: () => updateState(CRAFT_TOKENS.MODIFICATIONS, modifications => finishHistoryEditing(modifications)),
|
||||
}),
|
||||
mapSelfProps: ({offset}) => ({offset})
|
||||
})
|
||||
});
|
||||
|
||||
const NOOP = () => {};
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ function ActionMenu({actions, keymap, ...menuState}) {
|
|||
</Menu>;
|
||||
}
|
||||
|
||||
function ActionMenuItem({label, cssIcons, icon32, icon96, enabled, hotKey, visible, ...props}) {
|
||||
function ActionMenuItem({label, cssIcons, icon32, icon96, enabled, hotKey, visible, actionId, ...props}) {
|
||||
if (!visible) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -61,8 +61,7 @@ let ConnectedMenuItem = connect(ActionMenuItem,
|
|||
mapProps: ([{enabled, visible}, {label, cssIcons, icon32, icon96}]) => ({
|
||||
enabled, visible, label, cssIcons, icon32, icon96
|
||||
}),
|
||||
mapActions: mapActionBehavior(props => props.actionId),
|
||||
mapSelfProps: ({hotKey}) => ({hotKey})
|
||||
mapActions: mapActionBehavior(props => props.actionId)
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue