Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/meteor/app/ui-utils/client/lib/MessageAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type MessageActionConfig = {
icon: IconName;
variant?: 'danger' | 'success' | 'warning';
label: TranslationKey;
tooltip?: string;
order: number;
group: MessageActionGroup;
context?: MessageActionContext[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ const MessageToolbarActionMenu = ({ message, context, room, subscription, onChan
content: t(option.label),
onClick: option.action,
type: option.type,
...(option.tooltip && { tooltip: option.tooltip }),
...(typeof option.disabled === 'boolean' && { disabled: option.disabled }),
...(typeof option.disabled === 'boolean' &&
option.disabled && { tooltip: t('Action_not_available_encrypted_content', { action: t(option.label) }) }),
}))
.reduce((acc, option) => {
const group = option.type ? option.type : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ const MessageToolbarStarsActionMenu = ({ message, context, onChangeMenuVisibilit
content: t(option.label),
onClick: option.action,
type: option.type,
...(option.tooltip && { tooltip: option.tooltip }),
...(typeof option.disabled === 'boolean' && { disabled: option.disabled }),
...(typeof option.disabled === 'boolean' &&
option.disabled && { tooltip: t('Action_not_available_encrypted_content', { action: t(option.label) }) }),
};

const group = option.type || '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ export const usePermalinkAction = (
order,
group: 'menu',
disabled: encrypted,
...(encrypted && { tooltip: t('Action_not_available_encrypted_content', { action: t('Copy_link') }) }),
};
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type IMessage, type ISubscription, type IRoom, isE2EEMessage } from '@rocket.chat/core-typings';
import { usePermission, useRouter, useUser } from '@rocket.chat/ui-contexts';
import { useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useShallow } from 'zustand/shallow';

import type { MessageActionConfig } from '../../../../app/ui-utils/client/lib/MessageAction';
Expand All @@ -17,6 +18,7 @@ export const useReplyInDMAction = (
const encrypted = isE2EEMessage(message);
const canCreateDM = usePermission('create-d');
const isLayoutEmbedded = useEmbeddedLayout();
const { t } = useTranslation();

const roomPredicate = useCallback(
(record: IRoom): boolean => {
Expand Down Expand Up @@ -70,5 +72,6 @@ export const useReplyInDMAction = (
order: 0,
group: 'menu',
disabled: encrypted,
...(encrypted && { tooltip: t('Action_not_available_encrypted_content', { action: t('Reply_in_direct_message') }) }),
};
};
Loading