diff --git a/_locales/en/messages.json b/_locales/en/messages.json index b706b55eb..206c71fd3 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -195,6 +195,7 @@ "timerOption_1_week": "1 week", "timerOption_2_weeks": "2 weeks", "disappearingMessages": "Disappearing messages", + "disappearingMessagesSubtitle": "This setting applies to everyone in this conversation", "set": "Set", "changeNickname": "Change Nickname", "clearNickname": "Clear Nickname", diff --git a/ts/components/conversation/right-panel/overlay/OverlayDisappearingMessages.tsx b/ts/components/conversation/right-panel/overlay/OverlayDisappearingMessages.tsx index cd87db0e2..bb332a28c 100644 --- a/ts/components/conversation/right-panel/overlay/OverlayDisappearingMessages.tsx +++ b/ts/components/conversation/right-panel/overlay/OverlayDisappearingMessages.tsx @@ -2,14 +2,17 @@ import React, { useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import styled from 'styled-components'; import { setDisappearingMessagesByConvoId } from '../../../../interactions/conversationInteractions'; +import { closeRightPanel } from '../../../../state/ducks/conversations'; import { resetRightOverlayMode } from '../../../../state/ducks/section'; import { getSelectedConversationKey } from '../../../../state/selectors/conversations'; import { getTimerOptions } from '../../../../state/selectors/timerOptions'; +import { Flex } from '../../../basic/Flex'; import { SessionButton } from '../../../basic/SessionButton'; import { PanelButtonGroup } from '../../../buttons'; import { PanelRadioButton } from '../../../buttons/PanelRadioButton'; +import { SessionIconButton } from '../../../icon'; -const StyledContainer = styled.div` +const StyledContainer = styled(Flex)` width: 100%; .session-button { @@ -20,6 +23,64 @@ const StyledContainer = styled.div` } `; +const StyledTitle = styled.h2` + font-family: var(--font-default); + text-align: center; + margin-top: 0px; + margin-bottom: 0px; +`; + +const StyledSubTitle = styled.h3` + font-family: var(--font-default); + font-size: 11px; + font-weight: 400; + text-align: center; + padding-top: 0px; + margin-top: 0; +`; + +type HeaderProps = { + title: string; + subtitle: string; +}; + +const Header = (props: HeaderProps) => { + const { title, subtitle } = props; + const dispatch = useDispatch(); + + return ( + + { + dispatch(resetRightOverlayMode()); + }} + /> + + {title} + {subtitle} + + { + dispatch(closeRightPanel()); + dispatch(resetRightOverlayMode()); + }} + /> + + ); +}; + type TimerOptionsProps = { options: any[]; selected: number; @@ -48,21 +109,17 @@ const TimeOptions = (props: TimerOptionsProps) => { }; export const OverlayDisappearingMessages = () => { - const dispatch = useDispatch(); const selectedConversationKey = useSelector(getSelectedConversationKey); const timerOptions = useSelector(getTimerOptions).timerOptions; const [selected, setSelected] = useState(timerOptions[0].value); return ( - -
{ - dispatch(resetRightOverlayMode()); - }} - > - TODO -
+ +
{ diff --git a/ts/types/LocalizerKeys.ts b/ts/types/LocalizerKeys.ts index cb534dffa..172f5e292 100644 --- a/ts/types/LocalizerKeys.ts +++ b/ts/types/LocalizerKeys.ts @@ -461,6 +461,7 @@ export type LocalizerKeys = | 'stagedImageAttachment' | 'thisWeek' | 'savedTheFile' + | 'timerSetTo' | 'mediaEmptyState' | 'linkVisitWarningTitle' | 'invalidPassword' @@ -471,7 +472,7 @@ export type LocalizerKeys = | 'autoUpdateNewVersionMessage' | 'oneNonImageAtATimeToast' | 'reactionPopupMany' - | 'timerSetTo' + | 'disappearingMessagesSubtitle' | 'iAmSure' | 'primaryColorRed' | 'selectMessage'