Contextmenu left trigger fix for messageview

pull/726/head
Vincent 6 years ago
parent 3e57367ce6
commit 2439c6f95b

@ -1421,8 +1421,6 @@
// Module: Conversation Header // Module: Conversation Header
.module-conversation-header { .module-conversation-header {
padding-left: 16px;
padding-right: 16px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;

@ -430,7 +430,7 @@ $session-element-border-green: 4px solid $session-color-green;
@mixin standard-icon-button() { @mixin standard-icon-button() {
color: $session-color-white; color: $session-color-white;
opacity: 0.9; opacity: 0.6;
&:hover { &:hover {
opacity: 1; opacity: 1;
@ -439,6 +439,7 @@ $session-element-border-green: 4px solid $session-color-green;
.module-conversation-header__title-flex, .module-conversation-header__title-flex,
.module-conversation-header__title { .module-conversation-header__title {
font-family: Wasa;
width: 100%; width: 100%;
display: flex; display: flex;
@ -489,9 +490,9 @@ label {
@include standard-icon-button(); @include standard-icon-button();
} }
.module-conversation-header, .module-conversation-header {
.message-selection-overlay { position: relative;
height: $session-conversation-header-height; padding: 0px $session-margin-lg 0px $session-margin-sm
} }
.title-wrapper { .title-wrapper {
@ -1176,4 +1177,5 @@ button.module-scroll-down {
&-selected { &-selected {
background-color: $session-shade-8; background-color: $session-shade-8;
} }
} }

@ -2,7 +2,7 @@ import React from 'react';
import { Avatar } from '../Avatar'; import { Avatar } from '../Avatar';
import { Colors, LocalizerType } from '../../types/Util'; import { Colors, LocalizerType } from '../../types/Util';
import { ContextMenu, MenuItem, SubMenu } from 'react-contextmenu'; import { ContextMenu, ContextMenuTrigger, MenuItem, SubMenu } from 'react-contextmenu';
import { import {
SessionIconButton, SessionIconButton,
@ -243,7 +243,7 @@ export class ConversationHeader extends React.Component<Props> {
); );
} }
public renderOptions() { public renderOptions(triggerId: string) {
const { showBackButton } = this.props; const { showBackButton } = this.props;
if (showBackButton) { if (showBackButton) {
@ -251,12 +251,13 @@ export class ConversationHeader extends React.Component<Props> {
} }
return ( return (
<> <ContextMenuTrigger id={triggerId} ref={this.menuTriggerRef} holdToDisplay={1}>
<SessionIconButton <SessionIconButton
iconType={SessionIconType.Ellipses} iconType={SessionIconType.Ellipses}
iconSize={SessionIconSize.Large} iconSize={SessionIconSize.Large}
/> onClick={this.showMenuBound}
</> />
</ContextMenuTrigger>
); );
} }
@ -277,7 +278,7 @@ export class ConversationHeader extends React.Component<Props> {
const isPrivateGroup = isGroup && !isPublic; const isPrivateGroup = isGroup && !isPublic;
const copyIdLabel = isGroup ? i18n('copyChatId') : i18n('copyPublicKey'); const copyIdLabel = isGroup ? i18n('copyChatId') : i18n('copyPublicKey');
return ( return (
<ContextMenu id={triggerId}> <ContextMenu id={triggerId}>
@ -347,7 +348,7 @@ export class ConversationHeader extends React.Component<Props> {
{this.renderBackButton()} {this.renderBackButton()}
<div className="module-conversation-header__title-container"> <div className="module-conversation-header__title-container">
<div className="module-conversation-header__title-flex"> <div className="module-conversation-header__title-flex">
{this.renderOptions()} {this.renderOptions(triggerId)}
{this.renderTitle()} {this.renderTitle()}
{isPrivateGroup ? this.renderMemberCount() : null} {isPrivateGroup ? this.renderMemberCount() : null}
</div> </div>

@ -95,7 +95,7 @@ export const icons = {
[SessionIconType.Ellipses]: { [SessionIconType.Ellipses]: {
path: path:
'M30,16c4.411,0,8-3.589,8-8s-3.589-8-8-8s-8,3.589-8,8S25.589,16,30,16z M30,22c-4.411,0-8,3.589-8,8s3.589,8,8,8s8-3.589,8-8S34.411,22,30,22z M30,44c-4.411,0-8,3.589-8,8s3.589,8,8,8s8-3.589,8-8S34.411,44,30,44z', 'M30,16c4.411,0,8-3.589,8-8s-3.589-8-8-8s-8,3.589-8,8S25.589,16,30,16z M30,22c-4.411,0-8,3.589-8,8s3.589,8,8,8s8-3.589,8-8S34.411,22,30,22z M30,44c-4.411,0-8,3.589-8,8s3.589,8,8,8s8-3.589,8-8S34.411,44,30,44z',
viewBox: '-5 0 65 65', viewBox: '-5 -5 65 65',
}, },
[SessionIconType.Emoji]: { [SessionIconType.Emoji]: {
path: path:

Loading…
Cancel
Save