adding PR changes.

pull/1813/head
Warrick Corfe-Tan 4 years ago
parent 1a973f6573
commit a8a15e3f88

@ -417,8 +417,5 @@
"latestUnreadIsAbove": "First unread message is above", "latestUnreadIsAbove": "First unread message is above",
"sendRecoveryPhraseTitle": "Sending Recovery Phrase", "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?", "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$" "notificationSubtitle": "Notifications - $setting$"
} }

@ -7,8 +7,8 @@ import { SessionIconButton, SessionIconSize, SessionIconType } from '../session/
import { SessionButton, SessionButtonColor, SessionButtonType } from '../session/SessionButton'; import { SessionButton, SessionButtonColor, SessionButtonType } from '../session/SessionButton';
import { ConversationAvatar } from '../session/usingClosedConversationDetails'; import { ConversationAvatar } from '../session/usingClosedConversationDetails';
import { MemoConversationHeaderMenu } from '../session/menu/ConversationHeaderMenu'; import { MemoConversationHeaderMenu } from '../session/menu/ConversationHeaderMenu';
import { contextMenu } from 'react-contexify'; import { contextMenu, theme } from 'react-contexify';
import styled, { useTheme } from 'styled-components'; import styled, { ThemeProvider, useTheme } from 'styled-components';
import { ConversationNotificationSettingType } from '../../models/conversation'; import { ConversationNotificationSettingType } from '../../models/conversation';
import { import {
getConversationHeaderProps, getConversationHeaderProps,
@ -29,6 +29,7 @@ import {
openRightPanel, openRightPanel,
resetSelectedMessageIds, resetSelectedMessageIds,
} from '../../state/ducks/conversations'; } from '../../state/ducks/conversations';
import { getTheme } from '../../state/selectors/theme';
export interface TimerOption { export interface TimerOption {
name: string; name: string;
@ -86,7 +87,6 @@ const SelectionOverlay = (props: {
iconType={SessionIconType.Exit} iconType={SessionIconType.Exit}
iconSize={SessionIconSize.Medium} iconSize={SessionIconSize.Medium}
onClick={onCloseOverlay} onClick={onCloseOverlay}
theme={useTheme()}
/> />
</div> </div>
@ -120,7 +120,6 @@ const TripleDotsMenu = (props: { triggerId: string; showBackButton: boolean }) =
<SessionIconButton <SessionIconButton
iconType={SessionIconType.Ellipses} iconType={SessionIconType.Ellipses}
iconSize={SessionIconSize.Medium} iconSize={SessionIconSize.Medium}
theme={useTheme()}
/> />
</div> </div>
); );
@ -184,7 +183,6 @@ const BackButton = (props: { onGoBack: () => void; showBackButton: boolean }) =>
iconSize={SessionIconSize.Large} iconSize={SessionIconSize.Large}
iconRotation={90} iconRotation={90}
onClick={onGoBack} onClick={onGoBack}
theme={useTheme()}
/> />
); );
}; };
@ -199,7 +197,9 @@ export const StyledSubtitleContainer = styled.div`
justify-content: center; justify-content: center;
span { span {
margin-bottom: ${(p: StyledSubtitleContainerProps) => p.margin || '5px'}; margin-bottom: ${(p: StyledSubtitleContainerProps) => {
return p.margin || '5px'
}};
} }
span:last-child { span:last-child {
@ -207,6 +207,10 @@ export const StyledSubtitleContainer = styled.div`
} }
`; `;
// margin-bottom: ${(p: StyledSubtitleContainerProps) => {
// return p.margin || '5px';
// }};
export type ConversationHeaderTitleProps = { export type ConversationHeaderTitleProps = {
phoneNumber: string; phoneNumber: string;
profileName?: string; profileName?: string;
@ -256,10 +260,10 @@ const ConversationHeaderTitle = () => {
} }
})(); })();
let text = ''; let memberCountText = '';
if (isGroup && memberCount > 0) { if (isGroup && memberCount > 0) {
const count = String(memberCount); const count = String(memberCount);
text = i18n('members', [count]); memberCountText = i18n('members', [count]);
} }
const notificationSetting = useSelector(getCurrentNotificationSettingText); const notificationSetting = useSelector(getCurrentNotificationSettingText);
@ -267,12 +271,13 @@ const ConversationHeaderTitle = () => {
? window.i18n('notificationSubtitle', notificationSetting) ? window.i18n('notificationSubtitle', notificationSetting)
: null; : null;
const title = profileName || name || phoneNumber; const title = profileName || name || phoneNumber;
const marginXS = useTheme().common.margins.xs;
return ( return (
<div className="module-conversation-header__title"> <div className="module-conversation-header__title">
<span className="module-contact-name__profile-name">{title}</span> <span className="module-contact-name__profile-name">{title}</span>
<StyledSubtitleContainer margin={useTheme().common.margins.xs}> <StyledSubtitleContainer margin={marginXS}>
{isKickedFromGroup ? null : <ConversationHeaderSubtitle text={text} />} {isKickedFromGroup ? null : <ConversationHeaderSubtitle text={memberCountText} />}
<ConversationHeaderSubtitle text={notificationSubtitle} /> <ConversationHeaderSubtitle text={notificationSubtitle} />
</StyledSubtitleContainer> </StyledSubtitleContainer>
</div> </div>

@ -253,13 +253,13 @@ export const getCurrentNotificationSettingText = createSelector(getSelectedConve
} }
switch (state.currentNotificationSetting) { switch (state.currentNotificationSetting) {
case 'all': case 'all':
return window.i18n('all'); return window.i18n('notificationForConvo_all');
case 'mentions_only': case 'mentions_only':
return window.i18n('mentionsOnly'); return window.i18n('notificationForConvo_mentions_only');
case 'disabled': case 'disabled':
return window.i18n('disabled'); return window.i18n('notificationForConvo_mentions_disabled');
default: default:
return window.i18n('all'); return window.i18n('notificationForConvo_all');
} }
}); });

Loading…
Cancel
Save