You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
4 years ago
|
import React from 'react';
|
||
3 years ago
|
import { SessionRadioGroup } from '../basic/SessionRadioGroup';
|
||
4 years ago
|
import { SessionSettingsItemWrapper } from './SessionSettingListItem';
|
||
|
|
||
|
export const SessionNotificationGroupSettings = (props: { hasPassword: boolean | null }) => {
|
||
|
if (props.hasPassword === null) {
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
const initialItem = window.getSettingValue('notification-setting') || 'message';
|
||
|
|
||
|
const items = [
|
||
|
{
|
||
|
label: window.i18n('nameAndMessage'),
|
||
|
value: 'message',
|
||
|
},
|
||
|
{
|
||
|
label: window.i18n('nameOnly'),
|
||
|
value: 'name',
|
||
|
},
|
||
|
{
|
||
|
label: window.i18n('noNameOrMessage'),
|
||
|
value: 'count',
|
||
|
},
|
||
|
{
|
||
|
label: window.i18n('disableNotifications'),
|
||
|
value: 'off',
|
||
|
},
|
||
|
];
|
||
|
return (
|
||
|
<SessionSettingsItemWrapper title={window.i18n('notificationSettingsDialog')} inline={false}>
|
||
|
<SessionRadioGroup
|
||
|
initialItem={initialItem}
|
||
|
group={'notification-setting'}
|
||
|
items={items}
|
||
|
onClick={(selectedRadioValue: string) => {
|
||
|
window.setSettingValue('notification-setting', selectedRadioValue);
|
||
|
}}
|
||
|
/>
|
||
|
</SessionSettingsItemWrapper>
|
||
|
);
|
||
|
};
|