Remove Unpin option from maximised widget context menu (#7657)
parent
51446378e3
commit
efa1667d7e
|
@ -82,8 +82,11 @@ const WidgetContextMenu: React.FC<IProps> = ({
|
||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const pinnedWidgets = WidgetLayoutStore.instance.getContainerWidgets(room, Container.Top);
|
||||||
|
const widgetIndex = pinnedWidgets.findIndex(widget => widget.id === app.id);
|
||||||
|
|
||||||
let unpinButton;
|
let unpinButton;
|
||||||
if (showUnpin) {
|
if (showUnpin && widgetIndex >= 0) {
|
||||||
const onUnpinClick = () => {
|
const onUnpinClick = () => {
|
||||||
WidgetLayoutStore.instance.moveToContainer(room, app, Container.Right);
|
WidgetLayoutStore.instance.moveToContainer(room, app, Container.Right);
|
||||||
onFinished();
|
onFinished();
|
||||||
|
@ -175,9 +178,6 @@ const WidgetContextMenu: React.FC<IProps> = ({
|
||||||
revokeButton = <IconizedContextMenuOption onClick={onRevokeClick} label={_t("Revoke permissions")} />;
|
revokeButton = <IconizedContextMenuOption onClick={onRevokeClick} label={_t("Revoke permissions")} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pinnedWidgets = WidgetLayoutStore.instance.getContainerWidgets(room, Container.Top);
|
|
||||||
const widgetIndex = pinnedWidgets.findIndex(widget => widget.id === app.id);
|
|
||||||
|
|
||||||
let moveLeftButton;
|
let moveLeftButton;
|
||||||
if (showUnpin && widgetIndex > 0) {
|
if (showUnpin && widgetIndex > 0) {
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
|
|
|
@ -39,7 +39,7 @@ import PersistedElement, { getPersistKey } from "./PersistedElement";
|
||||||
import { WidgetType } from "../../../widgets/WidgetType";
|
import { WidgetType } from "../../../widgets/WidgetType";
|
||||||
import { StopGapWidget } from "../../../stores/widgets/StopGapWidget";
|
import { StopGapWidget } from "../../../stores/widgets/StopGapWidget";
|
||||||
import { ElementWidgetActions } from "../../../stores/widgets/ElementWidgetActions";
|
import { ElementWidgetActions } from "../../../stores/widgets/ElementWidgetActions";
|
||||||
import RoomWidgetContextMenu from "../context_menus/WidgetContextMenu";
|
import WidgetContextMenu from "../context_menus/WidgetContextMenu";
|
||||||
import WidgetAvatar from "../avatars/WidgetAvatar";
|
import WidgetAvatar from "../avatars/WidgetAvatar";
|
||||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||||
import CallHandler from '../../../CallHandler';
|
import CallHandler from '../../../CallHandler';
|
||||||
|
@ -573,7 +573,7 @@ export default class AppTile extends React.Component<IProps, IState> {
|
||||||
let contextMenu;
|
let contextMenu;
|
||||||
if (this.state.menuDisplayed) {
|
if (this.state.menuDisplayed) {
|
||||||
contextMenu = (
|
contextMenu = (
|
||||||
<RoomWidgetContextMenu
|
<WidgetContextMenu
|
||||||
{...aboveLeftOf(this.contextMenuButton.current.getBoundingClientRect(), null)}
|
{...aboveLeftOf(this.contextMenuButton.current.getBoundingClientRect(), null)}
|
||||||
app={this.props.app}
|
app={this.props.app}
|
||||||
onFinished={this.closeContextMenu}
|
onFinished={this.closeContextMenu}
|
||||||
|
|
Loading…
Reference in New Issue