-
-
Notifications
You must be signed in to change notification settings - Fork 301
Expand file tree
/
Copy pathnotifications.js
More file actions
75 lines (72 loc) · 2.03 KB
/
notifications.js
File metadata and controls
75 lines (72 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { FormattedMessage } from 'react-intl';
import messages from '../messages';
import { CustomField } from './customField';
import { SwitchToggleField } from './switchToggleField';
export function UserNotificationsForm(props) {
const fields = [
{
labelId: 'mentions',
descriptionId: 'mentionsDescription',
fieldName: 'mentionsNotifications',
default: true,
},
{
labelId: 'teamUpdates',
descriptionId: 'teamUpdatesDescription',
fieldName: 'teamsAnnouncementNotifications',
default: false,
},
{
labelId: 'taskValidationUpdates',
descriptionId: 'taskValidationUpdatesDescription',
fieldName: 'taskValidationNotification',
default: true,
},
{
labelId: 'taskInvalidationUpdates',
descriptionId: 'taskInvalidationUpdatesDescription',
fieldName: 'taskInvalidationNotification',
default: true,
},
{
labelId: 'projectUpdates',
descriptionId: 'projectUpdatesDescription',
fieldName: 'projectsNotifications',
default: true,
},
{
labelId: 'questionsAndComments',
descriptionId: 'questionsAndCommentsDescription',
fieldName: 'questionsAndCommentsNotifications',
default: false,
},
{
labelId: 'taskComments',
descriptionId: 'taskCommentsDescription',
fieldName: 'taskCommentsNotifications',
default: false,
},
];
return (
<div id="notifications" className="bg-white b--card ba br1 pa4 mb4">
<h3 className="f3 blue-dark mt0 fw7">
<FormattedMessage {...messages.notifications} />
</h3>
<div className="blue-grey">
{fields.map((field) => (
<CustomField
key={field.labelId}
labelId={field.labelId}
descriptionId={field.descriptionId}
>
<SwitchToggleField
fieldName={field.fieldName}
default={field.default}
removeVerticalPadding
/>
</CustomField>
))}
</div>
</div>
);
}