-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathNotificationMarkAsRead.tsx
128 lines (124 loc) · 3.87 KB
/
NotificationMarkAsRead.tsx
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import apiData from 'docs/server/apiData/apiData.ts';
import NotificationAPI from 'docs/server/routes/apisAndHooks/notificationAPI/NotificationAPI.tsx';
import { ClientLanguageDisplayNames } from 'docs/server/state/PreferenceContext.tsx';
import CodeBlock from 'docs/server/ui/codeBlock/CodeBlock.tsx';
import HR from 'docs/server/ui/hr/HR.tsx';
import Page from 'docs/server/ui/page/Page.tsx';
import PropertiesList from 'docs/server/ui/propertiesList/PropertiesList.tsx';
import { H2, H3 } from 'docs/server/ui/typography/Typography.tsx';
const uri = '/js-apis-and-hooks/notification-api/markAsRead';
const title = 'Mark notifications as read or unread';
const subtitle =
'How to use the notification API to mark some or all notifications as read or unread';
const methodData =
apiData['types']['ICordNotificationSDK']['methods']['methods'];
function NotificationMarkAsRead() {
return (
<Page
pretitle={NotificationAPI.title}
pretitleLinkTo={NotificationAPI.uri}
title={title}
pageSubtitle={subtitle}
showTableOfContents
>
<section>
<H2>Mark A Specific Notification As Read</H2>
<section>
<H3>Usage</H3>
<CodeBlock
snippetList={[
{
language: 'javascript',
languageDisplayName: ClientLanguageDisplayNames.VANILLA_JS,
snippet: methodData.markAsRead.examples.Usage,
},
]}
/>
</section>
<section>
<H3>What this function returns</H3>
<p>{methodData.markAsRead.returns.description}</p>
</section>
<PropertiesList
headingLevel={3}
headings={{
[ClientLanguageDisplayNames.VANILLA_JS]:
'Arguments this function takes',
}}
properties={{
[ClientLanguageDisplayNames.VANILLA_JS]:
methodData.markAsRead.parameters,
}}
/>
</section>
<HR />
<section>
<H2>Mark A Specific Notification As Unread</H2>
<section>
<H3>Usage</H3>
<CodeBlock
snippetList={[
{
language: 'javascript',
languageDisplayName: ClientLanguageDisplayNames.VANILLA_JS,
snippet: methodData.markAsUnread.examples.Usage,
},
]}
/>
</section>
<section>
<H3>What this function returns</H3>
<p>{methodData.markAsUnread.returns.description}</p>
</section>
<PropertiesList
headingLevel={3}
headings={{
[ClientLanguageDisplayNames.VANILLA_JS]:
'Arguments this function takes',
}}
properties={{
[ClientLanguageDisplayNames.VANILLA_JS]:
methodData.markAsUnread.parameters,
}}
/>
</section>
<HR />
<section>
<H2>Mark All Notifications As Read</H2>
<section>
<H3>Usage</H3>
<CodeBlock
snippetList={[
{
language: 'javascript',
languageDisplayName: ClientLanguageDisplayNames.VANILLA_JS,
snippet: methodData.markAllAsRead.examples.Usage,
},
]}
/>
</section>
<section>
<H3>What this function returns</H3>
<p>{methodData.markAllAsRead.returns.description}</p>
</section>
<PropertiesList
headingLevel={3}
headings={{
[ClientLanguageDisplayNames.VANILLA_JS]:
'Arguments this function takes',
}}
properties={{
[ClientLanguageDisplayNames.VANILLA_JS]:
methodData.markAllAsRead.parameters,
}}
/>
</section>
</Page>
);
}
export default {
uri,
title,
subtitle,
Element: NotificationMarkAsRead,
};