Disable header more menu in select mode
This commit is contained in:
parent
0aad09682d
commit
66f97b1c25
4 changed files with 46 additions and 25 deletions
|
@ -162,39 +162,42 @@
|
||||||
|
|
||||||
&:disabled {
|
&:disabled {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--show-disabled {
|
&--show-disabled {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include light-theme {
|
&:not(:disabled) {
|
||||||
&:hover,
|
@include light-theme {
|
||||||
&:focus {
|
&:hover,
|
||||||
background: $color-gray-02;
|
&:focus {
|
||||||
|
background: $color-gray-02;
|
||||||
|
}
|
||||||
|
&:active {
|
||||||
|
background: $color-gray-05;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&:active {
|
@include dark-theme {
|
||||||
background: $color-gray-05;
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
background: $color-gray-80;
|
||||||
|
}
|
||||||
|
&:active {
|
||||||
|
background: $color-gray-75;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@include dark-theme {
|
|
||||||
&:hover,
|
|
||||||
&:focus {
|
|
||||||
background: $color-gray-80;
|
|
||||||
}
|
|
||||||
&:active {
|
|
||||||
background: $color-gray-75;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include keyboard-mode {
|
@include keyboard-mode {
|
||||||
&:focus {
|
&:focus {
|
||||||
border-color: $color-ultramarine;
|
border-color: $color-ultramarine;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
@include dark-keyboard-mode {
|
||||||
@include dark-keyboard-mode {
|
&:focus {
|
||||||
&:focus {
|
border-color: $color-ultramarine-light;
|
||||||
border-color: $color-ultramarine-light;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ const commonProps = {
|
||||||
cannotLeaveBecauseYouAreLastAdmin: false,
|
cannotLeaveBecauseYouAreLastAdmin: false,
|
||||||
showBackButton: false,
|
showBackButton: false,
|
||||||
outgoingCallButtonStyle: OutgoingCallButtonStyle.Both,
|
outgoingCallButtonStyle: OutgoingCallButtonStyle.Both,
|
||||||
|
isSelectMode: false,
|
||||||
|
|
||||||
i18n,
|
i18n,
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ export type PropsDataType = {
|
||||||
isMissingMandatoryProfileSharing?: boolean;
|
isMissingMandatoryProfileSharing?: boolean;
|
||||||
outgoingCallButtonStyle: OutgoingCallButtonStyle;
|
outgoingCallButtonStyle: OutgoingCallButtonStyle;
|
||||||
isSMSOnly?: boolean;
|
isSMSOnly?: boolean;
|
||||||
|
isSelectMode: boolean;
|
||||||
isSignalConversation?: boolean;
|
isSignalConversation?: boolean;
|
||||||
theme: ThemeType;
|
theme: ThemeType;
|
||||||
} & Pick<
|
} & Pick<
|
||||||
|
@ -287,10 +288,14 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderMoreButton(triggerId: string): ReactNode {
|
private renderMoreButton(triggerId: string): ReactNode {
|
||||||
const { i18n } = this.props;
|
const { i18n, isSelectMode } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ContextMenuTrigger id={triggerId} ref={this.menuTriggerRef}>
|
<ContextMenuTrigger
|
||||||
|
id={triggerId}
|
||||||
|
ref={this.menuTriggerRef}
|
||||||
|
disable={isSelectMode}
|
||||||
|
>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={this.showMenuBound}
|
onClick={this.showMenuBound}
|
||||||
|
@ -299,6 +304,7 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
|
||||||
'module-ConversationHeader__button--more'
|
'module-ConversationHeader__button--more'
|
||||||
)}
|
)}
|
||||||
aria-label={i18n('icu:moreInfo')}
|
aria-label={i18n('icu:moreInfo')}
|
||||||
|
disabled={isSelectMode}
|
||||||
/>
|
/>
|
||||||
</ContextMenuTrigger>
|
</ContextMenuTrigger>
|
||||||
);
|
);
|
||||||
|
@ -339,6 +345,7 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
|
||||||
onArchive,
|
onArchive,
|
||||||
onMarkUnread,
|
onMarkUnread,
|
||||||
toggleSelectMode,
|
toggleSelectMode,
|
||||||
|
isSelectMode,
|
||||||
onMoveToInbox,
|
onMoveToInbox,
|
||||||
pushPanelForConversation,
|
pushPanelForConversation,
|
||||||
setDisappearingMessages,
|
setDisappearingMessages,
|
||||||
|
@ -346,6 +353,11 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
|
||||||
setPinned,
|
setPinned,
|
||||||
type,
|
type,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
|
if (isSelectMode) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const isRTL = i18n.getLocaleDirection() === 'rtl';
|
const isRTL = i18n.getLocaleDirection() === 'rtl';
|
||||||
|
|
||||||
const muteOptions = getMuteOptions(muteExpiresAt, i18n);
|
const muteOptions = getMuteOptions(muteExpiresAt, i18n);
|
||||||
|
|
|
@ -15,6 +15,7 @@ import {
|
||||||
getConversationByServiceIdSelector,
|
getConversationByServiceIdSelector,
|
||||||
getConversationSelector,
|
getConversationSelector,
|
||||||
getHasPanelOpen,
|
getHasPanelOpen,
|
||||||
|
getSelectedMessageIds,
|
||||||
isMissingRequiredProfileSharing,
|
isMissingRequiredProfileSharing,
|
||||||
} from '../selectors/conversations';
|
} from '../selectors/conversations';
|
||||||
import { CallMode } from '../../types/Calling';
|
import { CallMode } from '../../types/Calling';
|
||||||
|
@ -123,6 +124,9 @@ export function SmartConversationHeader({ id }: OwnProps): JSX.Element {
|
||||||
const cannotLeaveBecauseYouAreLastAdmin =
|
const cannotLeaveBecauseYouAreLastAdmin =
|
||||||
getCannotLeaveBecauseYouAreLastAdmin(groupMemberships.memberships, isAdmin);
|
getCannotLeaveBecauseYouAreLastAdmin(groupMemberships.memberships, isAdmin);
|
||||||
|
|
||||||
|
const selectedMessageIds = useSelector(getSelectedMessageIds);
|
||||||
|
const isSelectMode = selectedMessageIds != null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ConversationHeader
|
<ConversationHeader
|
||||||
{...pick(conversation, [
|
{...pick(conversation, [
|
||||||
|
@ -175,6 +179,7 @@ export function SmartConversationHeader({ id }: OwnProps): JSX.Element {
|
||||||
setMuteExpiration={setMuteExpiration}
|
setMuteExpiration={setMuteExpiration}
|
||||||
setPinned={setPinned}
|
setPinned={setPinned}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
|
isSelectMode={isSelectMode}
|
||||||
toggleSelectMode={toggleSelectMode}
|
toggleSelectMode={toggleSelectMode}
|
||||||
viewUserStories={viewUserStories}
|
viewUserStories={viewUserStories}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue