From 901e402a5cd6dbceeaed83e3256db6d7eecfc3f4 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 2 Dec 2019 23:23:11 +0000 Subject: [PATCH] apply renames suggested in PR review Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/ContextMenu.js | 2 +- src/components/views/elements/AppTile.js | 4 ++-- .../views/messages/MessageActionBar.js | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/structures/ContextMenu.js b/src/components/structures/ContextMenu.js index 4927d219b2..bc3d91a477 100644 --- a/src/components/structures/ContextMenu.js +++ b/src/components/structures/ContextMenu.js @@ -415,7 +415,7 @@ export const toRightOf = (elementRect, chevronOffset=12) => { }; // Placement method for to position context menu right-aligned and flowing to the left of elementRect -export const aboveLeft = (elementRect, chevronFace="none") => { +export const aboveLeftOf = (elementRect, chevronFace="none") => { const menuOptions = { chevronFace }; const buttonRight = elementRect.right + window.pageXOffset; diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 003103f9cb..55cb9a5487 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -35,7 +35,7 @@ import ActiveWidgetStore from '../../../stores/ActiveWidgetStore'; import classNames from 'classnames'; import {IntegrationManagers} from "../../../integrations/IntegrationManagers"; import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore"; -import {aboveLeft, ContextMenu, ContextMenuButton} from "../../structures/ContextMenu"; +import {aboveLeftOf, ContextMenu, ContextMenuButton} from "../../structures/ContextMenu"; import PersistedElement from "./PersistedElement"; const ALLOWED_APP_URL_SCHEMES = ['https:', 'http:']; @@ -678,7 +678,7 @@ export default class AppTile extends React.Component { const WidgetContextMenu = sdk.getComponent('views.context_menus.WidgetContextMenu'); contextMenu = ( - + { - const [menuDisplayed, _button, openMenu, closeMenu] = useContextMenu(); + const [menuDisplayed, button, openMenu, closeMenu] = useContextMenu(); useEffect(() => { onFocusChange(menuDisplayed); }, [onFocusChange, menuDisplayed]); @@ -52,8 +52,8 @@ const OptionsButton = ({mxEvent, getTile, getReplyThread, permalinkCreator, onFo e2eInfoCallback = onCryptoClick; } - const buttonRect = _button.current.getBoundingClientRect(); - contextMenu = + const buttonRect = button.current.getBoundingClientRect(); + contextMenu = { contextMenu } @@ -79,13 +79,13 @@ const OptionsButton = ({mxEvent, getTile, getReplyThread, permalinkCreator, onFo }; const ReactButton = ({mxEvent, reactions}) => { - const [menuDisplayed, _button, openMenu, closeMenu] = useContextMenu(); + const [menuDisplayed, button, openMenu, closeMenu] = useContextMenu(); let contextMenu; if (menuDisplayed) { - const buttonRect = _button.current.getBoundingClientRect(); + const buttonRect = button.current.getBoundingClientRect(); const ReactionPicker = sdk.getComponent('emojipicker.ReactionPicker'); - contextMenu = + contextMenu = ; } @@ -96,7 +96,7 @@ const ReactButton = ({mxEvent, reactions}) => { label={_t("React")} onClick={openMenu} isExpanded={menuDisplayed} - inputRef={_button} + inputRef={button} /> { contextMenu }