diff --git a/app/soapbox/features/chats/components/chat-page/components/chat-page-main.tsx b/app/soapbox/features/chats/components/chat-page/components/chat-page-main.tsx index 85b8922652..114bafad80 100644 --- a/app/soapbox/features/chats/components/chat-page/components/chat-page-main.tsx +++ b/app/soapbox/features/chats/components/chat-page/components/chat-page-main.tsx @@ -5,7 +5,7 @@ import { Link, useHistory, useParams } from 'react-router-dom'; import { blockAccount, unblockAccount } from 'soapbox/actions/accounts'; import { openModal } from 'soapbox/actions/modals'; import List, { ListItem } from 'soapbox/components/list'; -import { Avatar, HStack, Icon, IconButton, Menu, MenuButton, MenuItem, MenuList, Stack, Text } from 'soapbox/components/ui'; +import { Avatar, HStack, Icon, IconButton, Menu, MenuButton, MenuItem, MenuList, Stack, Text, Tooltip } from 'soapbox/components/ui'; import VerificationBadge from 'soapbox/components/verification_badge'; import { useChatContext } from 'soapbox/contexts/chat-context'; import { useAppDispatch, useAppSelector, useFeatures } from 'soapbox/hooks'; @@ -37,6 +37,7 @@ const messages = defineMessages({ autoDelete30Days: { id: 'chat_settings.auto_delete.30days', defaultMessage: '30 days' }, autoDelete90Days: { id: 'chat_settings.auto_delete.90days', defaultMessage: '90 days' }, autoDeleteMessage: { id: 'chat_window.auto_delete_label', defaultMessage: 'Auto-delete after {day} days' }, + autoDeleteMessageTooltip: { id: 'chat_window.auto_delete_tooltip', defaultMessage: 'Chat messages are set to auto-delete after {day} days days upon sending.' }, }); const ChatPageMain = () => { @@ -129,16 +130,20 @@ const ChatPageMain = () => { {chat.message_expiration && ( - - {intl.formatMessage(messages.autoDeleteMessage, { day: secondsToDays(chat.message_expiration) })} - + + {intl.formatMessage(messages.autoDeleteMessage, { day: secondsToDays(chat.message_expiration) })} + + )} diff --git a/app/soapbox/features/chats/components/chat-widget/chat-window.tsx b/app/soapbox/features/chats/components/chat-widget/chat-window.tsx index 48b38ba257..f8b8b1f393 100644 --- a/app/soapbox/features/chats/components/chat-widget/chat-window.tsx +++ b/app/soapbox/features/chats/components/chat-widget/chat-window.tsx @@ -2,7 +2,7 @@ import React, { useRef } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { Link } from 'react-router-dom'; -import { Avatar, HStack, Icon, Stack, Text } from 'soapbox/components/ui'; +import { Avatar, HStack, Icon, Stack, Text, Tooltip } from 'soapbox/components/ui'; import VerificationBadge from 'soapbox/components/verification_badge'; import { ChatWidgetScreens, useChatContext } from 'soapbox/contexts/chat-context'; import { secondsToDays } from 'soapbox/utils/numbers'; @@ -14,6 +14,7 @@ import ChatSettings from './chat-settings'; const messages = defineMessages({ autoDeleteMessage: { id: 'chat_window.auto_delete_label', defaultMessage: 'Auto-delete after {day} days' }, + autoDeleteMessageTooltip: { id: 'chat_window.auto_delete_tooltip', defaultMessage: 'Chat messages are set to auto-delete after {day} days days upon sending.' }, }); const LinkWrapper = ({ enabled, to, children }: { enabled: boolean, to: string, children: React.ReactNode }): JSX.Element => { @@ -84,19 +85,24 @@ const ChatWindow = () => { )} - - + +
{chat.account.display_name || `@${chat.account.acct}`} {chat.account.verified && }
- {chat.message_expiration && ( - +
+ + {chat.message_expiration && ( + + {intl.formatMessage(messages.autoDeleteMessage, { day: secondsToDays(chat.message_expiration) })} - )} -
-
+ + )} + }