From 6c9c025d2522cbba3fd516f6a1e3fcaf0edebc76 Mon Sep 17 00:00:00 2001 From: Christopher Poile Date: Mon, 23 Jan 2023 09:38:07 -0500 Subject: [PATCH] MM-49746 - Calls: Show call thread title in root calls post (#6992) * add thread title to calls custom posts * PR comments --- .../calls_custom_message.tsx | 149 ++++++++++-------- 1 file changed, 82 insertions(+), 67 deletions(-) diff --git a/app/products/calls/components/calls_custom_message/calls_custom_message.tsx b/app/products/calls/components/calls_custom_message/calls_custom_message.tsx index 16640f43f0..fd7eb29252 100644 --- a/app/products/calls/components/calls_custom_message/calls_custom_message.tsx +++ b/app/products/calls/components/calls_custom_message/calls_custom_message.tsx @@ -14,6 +14,7 @@ import FormattedTime from '@components/formatted_time'; import {useServerUrl} from '@context/server'; import {useTheme} from '@context/theme'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; +import {typography} from '@utils/typography'; import {displayUsername, getUserTimezone} from '@utils/user'; import type {LimitRestrictedInfo} from '@calls/observers'; @@ -35,6 +36,10 @@ type Props = { const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { return { + title: { + ...typography('Heading', 500), + color: theme.centerChannelColor, + }, messageStyle: { flexDirection: 'row', color: changeOpacity(theme.centerChannelColor, 0.6), @@ -133,97 +138,107 @@ export const CallsCustomMessage = ({ leaveAndJoinWithAlert(intl, serverUrl, post.channelId, leaveChannelName || '', joinChannelName || '', confirmToJoin, false, Boolean(joinChannelIsDMorGM)); }; + const title = post.props.title ? ( + + {post.props.title} + + ) : null; + if (post.props.end_at) { return ( - - - - + {title} + + - + - {' '} - { + + + {' '} - } - {'•'} - + {'•'} + + - + ); } const joinTextStyle = [style.joinCallButtonText, isLimitRestricted && style.joinCallButtonTextRestricted]; return ( - - - - - - - - + <> + {title} + - { - alreadyInTheCall && + - } - { - !alreadyInTheCall && - - } - - + + + + + { + alreadyInTheCall && + + } + { + !alreadyInTheCall && + + } + + + ); };