From 0c10385dd2e972cec04eaeacfcc60e185095dd74 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Fri, 28 Jan 2022 12:22:45 +0000 Subject: [PATCH] Remove unused code from Stickerpicker (#7663) Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/Stickerpicker.tsx | 49 -------------------- 1 file changed, 49 deletions(-) diff --git a/src/components/views/rooms/Stickerpicker.tsx b/src/components/views/rooms/Stickerpicker.tsx index aab1386082..5509c53e8f 100644 --- a/src/components/views/rooms/Stickerpicker.tsx +++ b/src/components/views/rooms/Stickerpicker.tsx @@ -55,9 +55,6 @@ interface IProps { interface IState { imError: string; - stickerpickerX: number; - stickerpickerY: number; - stickerpickerChevronOffset?: number; stickerpickerWidget: IWidgetEvent; widgetId: string; } @@ -83,8 +80,6 @@ export default class Stickerpicker extends React.PureComponent { super(props); this.state = { imError: null, - stickerpickerX: null, - stickerpickerY: null, stickerpickerWidget: null, widgetId: null, }; @@ -322,47 +317,6 @@ export default class Stickerpicker extends React.PureComponent { return stickersContent; } - // Dev note: this isn't jsdoc because it's angry. - /* - * Show the sticker picker overlay - * If no stickerpacks have been added, show a link to the integration manager add sticker packs page. - */ - private onShowStickersClick = (e: React.MouseEvent): void => { - if (!SettingsStore.getValue("integrationProvisioning")) { - // Intercept this case and spawn a warning. - return IntegrationManagers.sharedInstance().showDisabledDialog(); - } - - // XXX: Simplify by using a context menu that is positioned relative to the sticker picker button - - const buttonRect = e.currentTarget.getBoundingClientRect(); - - // The window X and Y offsets are to adjust position when zoomed in to page - let x = buttonRect.right + window.pageXOffset - 41; - - // Amount of horizontal space between the right of menu and the right of the viewport - // (10 = amount needed to make chevron centrally aligned) - const rightPad = 10; - - // When the sticker picker would be displayed off of the viewport, adjust x - // (302 = width of context menu, including borders) - x = Math.min(x, document.body.clientWidth - (302 + rightPad)); - - // Offset the chevron location, which is relative to the left of the context menu - // (10 = offset when context menu would not be displayed off viewport) - // (2 = context menu borders) - const stickerpickerChevronOffset = Math.max(10, 2 + window.pageXOffset + buttonRect.left - x); - - const y = (buttonRect.top + (buttonRect.height / 2) + window.pageYOffset) - 19; - - this.props.setStickerPickerOpen(true); - this.setState({ - stickerpickerX: x, - stickerpickerY: y, - stickerpickerChevronOffset, - }); - }; - /** * Called when the window is resized */ @@ -405,10 +359,7 @@ export default class Stickerpicker extends React.PureComponent { if (!this.props.isStickerPickerOpen) return null; return