From a8a15e3f88b6c8d12e90bbef5033da972412fbd2 Mon Sep 17 00:00:00 2001 From: Warrick Corfe-Tan Date: Mon, 2 Aug 2021 10:52:53 +1000 Subject: [PATCH] adding PR changes. --- _locales/en/messages.json | 3 --- .../conversation/ConversationHeader.tsx | 25 +++++++++++-------- ts/state/selectors/conversations.ts | 8 +++--- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index ff578d86e..7b5f04fb1 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -417,8 +417,5 @@ "latestUnreadIsAbove": "First unread message is above", "sendRecoveryPhraseTitle": "Sending Recovery Phrase", "sendRecoveryPhraseMessage": "You are attempting to send your recovery phrase which can be used to access your account. Are you sure you want to send this message?", - "all": "All", - "mentionsOnly": "Mentions only", - "disabled": "Disabled", "notificationSubtitle": "Notifications - $setting$" } diff --git a/ts/components/conversation/ConversationHeader.tsx b/ts/components/conversation/ConversationHeader.tsx index 27c1d8e48..8c9af09bb 100644 --- a/ts/components/conversation/ConversationHeader.tsx +++ b/ts/components/conversation/ConversationHeader.tsx @@ -7,8 +7,8 @@ import { SessionIconButton, SessionIconSize, SessionIconType } from '../session/ import { SessionButton, SessionButtonColor, SessionButtonType } from '../session/SessionButton'; import { ConversationAvatar } from '../session/usingClosedConversationDetails'; import { MemoConversationHeaderMenu } from '../session/menu/ConversationHeaderMenu'; -import { contextMenu } from 'react-contexify'; -import styled, { useTheme } from 'styled-components'; +import { contextMenu, theme } from 'react-contexify'; +import styled, { ThemeProvider, useTheme } from 'styled-components'; import { ConversationNotificationSettingType } from '../../models/conversation'; import { getConversationHeaderProps, @@ -29,6 +29,7 @@ import { openRightPanel, resetSelectedMessageIds, } from '../../state/ducks/conversations'; +import { getTheme } from '../../state/selectors/theme'; export interface TimerOption { name: string; @@ -86,7 +87,6 @@ const SelectionOverlay = (props: { iconType={SessionIconType.Exit} iconSize={SessionIconSize.Medium} onClick={onCloseOverlay} - theme={useTheme()} /> @@ -120,7 +120,6 @@ const TripleDotsMenu = (props: { triggerId: string; showBackButton: boolean }) = ); @@ -184,7 +183,6 @@ const BackButton = (props: { onGoBack: () => void; showBackButton: boolean }) => iconSize={SessionIconSize.Large} iconRotation={90} onClick={onGoBack} - theme={useTheme()} /> ); }; @@ -199,7 +197,9 @@ export const StyledSubtitleContainer = styled.div` justify-content: center; span { - margin-bottom: ${(p: StyledSubtitleContainerProps) => p.margin || '5px'}; + margin-bottom: ${(p: StyledSubtitleContainerProps) => { + return p.margin || '5px' + }}; } span:last-child { @@ -207,6 +207,10 @@ export const StyledSubtitleContainer = styled.div` } `; +// margin-bottom: ${(p: StyledSubtitleContainerProps) => { +// return p.margin || '5px'; +// }}; + export type ConversationHeaderTitleProps = { phoneNumber: string; profileName?: string; @@ -256,10 +260,10 @@ const ConversationHeaderTitle = () => { } })(); - let text = ''; + let memberCountText = ''; if (isGroup && memberCount > 0) { const count = String(memberCount); - text = i18n('members', [count]); + memberCountText = i18n('members', [count]); } const notificationSetting = useSelector(getCurrentNotificationSettingText); @@ -267,12 +271,13 @@ const ConversationHeaderTitle = () => { ? window.i18n('notificationSubtitle', notificationSetting) : null; const title = profileName || name || phoneNumber; + const marginXS = useTheme().common.margins.xs; return (
{title} - - {isKickedFromGroup ? null : } + + {isKickedFromGroup ? null : }
diff --git a/ts/state/selectors/conversations.ts b/ts/state/selectors/conversations.ts index 7be618d2d..4a4f6879e 100644 --- a/ts/state/selectors/conversations.ts +++ b/ts/state/selectors/conversations.ts @@ -253,13 +253,13 @@ export const getCurrentNotificationSettingText = createSelector(getSelectedConve } switch (state.currentNotificationSetting) { case 'all': - return window.i18n('all'); + return window.i18n('notificationForConvo_all'); case 'mentions_only': - return window.i18n('mentionsOnly'); + return window.i18n('notificationForConvo_mentions_only'); case 'disabled': - return window.i18n('disabled'); + return window.i18n('notificationForConvo_mentions_disabled'); default: - return window.i18n('all'); + return window.i18n('notificationForConvo_all'); } });