Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1822 from matrix-org/rxl881/stickerPickerStyling
Browse files Browse the repository at this point in the history
Sticker picker styling
  • Loading branch information
rxl881 committed Apr 4, 2018
2 parents 06f1c50 + da6c2c5 commit 6a7d4cb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/components/structures/ContextualMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -138,6 +148,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!
Expand Down
2 changes: 2 additions & 0 deletions src/components/views/rooms/Stickerpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ export default class Stickerpicker extends React.Component {
element: this._getStickerpickerContent(),
onFinished: this._onFinished,
menuPaddingTop: 0,
menuPaddingLeft: 0,
menuPaddingRight: 0,
});


Expand Down

0 comments on commit 6a7d4cb

Please sign in to comment.