feat: added panel label for timer options

pull/2660/head
William Grant 2 years ago
parent 46a8801d8e
commit 6b06e4a70b

@ -178,6 +178,7 @@
"messageBody": "Message body", "messageBody": "Message body",
"unblockToSend": "Unblock this contact to send a message.", "unblockToSend": "Unblock this contact to send a message.",
"unblockGroupToSend": "This group is blocked. Unlock it if you would like to send a message.", "unblockGroupToSend": "This group is blocked. Unlock it if you would like to send a message.",
"timer": "Timer",
"youChangedTheTimer": "You set the disappearing message timer to $time$", "youChangedTheTimer": "You set the disappearing message timer to $time$",
"timerSetOnSync": "Updated disappearing message timer to $time$", "timerSetOnSync": "Updated disappearing message timer to $time$",
"theyChangedTheTimer": "$name$ set the disappearing message timer to $time$", "theyChangedTheTimer": "$name$ set the disappearing message timer to $time$",

@ -21,6 +21,14 @@ export const StyledText = styled.span`
text-align: left; text-align: left;
`; `;
export const PanelLabel = styled.p`
color: var(--text-secondary-color);
width: 100%;
margin: 0;
padding-left: calc(var(--margins-lg) * 2 + var(--margins-sm));
padding-bottom: var(--margins-sm);
`;
const StyledRoundedPanelButtonGroup = styled.div` const StyledRoundedPanelButtonGroup = styled.div`
overflow: hidden; overflow: hidden;
background: var(--right-panel-item-background-color); background: var(--right-panel-item-background-color);

@ -9,6 +9,7 @@ import { getTimerOptions } from '../../../../state/selectors/timerOptions';
import { Flex } from '../../../basic/Flex'; import { Flex } from '../../../basic/Flex';
import { SessionButton } from '../../../basic/SessionButton'; import { SessionButton } from '../../../basic/SessionButton';
import { PanelButtonGroup } from '../../../buttons'; import { PanelButtonGroup } from '../../../buttons';
import { PanelLabel } from '../../../buttons/PanelButton';
import { PanelRadioButton } from '../../../buttons/PanelRadioButton'; import { PanelRadioButton } from '../../../buttons/PanelRadioButton';
import { SessionIconButton } from '../../../icon'; import { SessionIconButton } from '../../../icon';
@ -91,20 +92,23 @@ const TimeOptions = (props: TimerOptionsProps) => {
const { options, selected, setSelected } = props; const { options, selected, setSelected } = props;
return ( return (
<PanelButtonGroup> <>
{options.map((option: any) => ( <PanelLabel>{window.i18n('timer')}</PanelLabel>
<PanelRadioButton <PanelButtonGroup>
key={option.name} {options.map((option: any) => (
text={option.name} <PanelRadioButton
value={option.name} key={option.name}
isSelected={selected === option.value} text={option.name}
onSelect={() => { value={option.name}
setSelected(option.value); isSelected={selected === option.value}
}} onSelect={() => {
disableBg={true} setSelected(option.value);
/> }}
))} disableBg={true}
</PanelButtonGroup> />
))}
</PanelButtonGroup>
</>
); );
}; };

@ -188,6 +188,7 @@ export type LocalizerKeys =
| 'areYouSureDeleteEntireAccount' | 'areYouSureDeleteEntireAccount'
| 'noGivenPassword' | 'noGivenPassword'
| 'closedGroupInviteOkText' | 'closedGroupInviteOkText'
| 'timer'
| 'readReceiptSettingTitle' | 'readReceiptSettingTitle'
| 'copySessionID' | 'copySessionID'
| 'timerOption_0_seconds' | 'timerOption_0_seconds'

Loading…
Cancel
Save