From 702380c5910194198f0f2b0e535dfa7f12e5faf3 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Wed, 4 Apr 2018 13:37:52 +0100 Subject: [PATCH 1/3] Add props to style (remaining) menu padding attributes. --- src/components/structures/ContextualMenu.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/structures/ContextualMenu.js b/src/components/structures/ContextualMenu.js index 59a68181c3..da69c38d73 100644 --- a/src/components/structures/ContextualMenu.js +++ b/src/components/structures/ContextualMenu.js @@ -138,6 +138,15 @@ module.exports = { if (!isNaN(Number(props.menuPaddingTop))) { menuStyle["paddingTop"] = props.menuPaddingTop; } + if (!isNaN(Number(props.menuPaddingLeft))) { + menuStyle["paddingLeft"] = props.menuPaddingLeft; + } + if (!isNaN(Number(props.menuPaddingBottom))) { + menuStyle["paddingBottom"] = props.menuPaddingBottom; + } + if (!isNaN(Number(props.menuPaddingRight))) { + menuStyle["paddingRight"] = props.menuPaddingRight; + } // FIXME: If a menu uses getDefaultProps it clobbers the onFinished // property set here so you can't close the menu from a button click! From 369cbdaaf62ced1e3e8ab034f90046ab0fe27977 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Wed, 4 Apr 2018 13:38:07 +0100 Subject: [PATCH 2/3] Add missing PropType declarations. --- src/components/structures/ContextualMenu.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/structures/ContextualMenu.js b/src/components/structures/ContextualMenu.js index da69c38d73..0e2df890f3 100644 --- a/src/components/structures/ContextualMenu.js +++ b/src/components/structures/ContextualMenu.js @@ -30,11 +30,21 @@ module.exports = { ContextualMenuContainerId: "mx_ContextualMenu_Container", propTypes: { + top: PropTypes.number, + bottom: PropTypes.number, + left: PropTypes.number, + right: PropTypes.number, menuWidth: PropTypes.number, menuHeight: PropTypes.number, chevronOffset: PropTypes.number, menuColour: PropTypes.string, chevronFace: PropTypes.string, // top, bottom, left, right + // Function to be called on menu close + onFinished: PropTypes.func, + menuPaddingTop: PropTypes.number, + menuPaddingRight: PropTypes.number, + menuPaddingBottom: PropTypes.number, + menuPaddingLeft: PropTypes.number, }, getOrCreateContainer: function() { From da6c2c51fb8a744df78945dd151c2ac0e8f30e59 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Wed, 4 Apr 2018 13:38:48 +0100 Subject: [PATCH 3/3] Remove left and right menu padding --- src/components/views/rooms/Stickerpicker.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/views/rooms/Stickerpicker.js b/src/components/views/rooms/Stickerpicker.js index e45f0e8f1b..929e0b0d83 100644 --- a/src/components/views/rooms/Stickerpicker.js +++ b/src/components/views/rooms/Stickerpicker.js @@ -217,6 +217,8 @@ export default class Stickerpicker extends React.Component { element: this._getStickerpickerContent(), onFinished: this._onFinished, menuPaddingTop: 0, + menuPaddingLeft: 0, + menuPaddingRight: 0, });