@@ -58,7 +58,7 @@ const config = {
5858
5959
6060```
61- The config is a prop for the SirenProvider component is authenticate and initialize sdk.
61+ The config is a property containing userToken and recipientId for authenticate and initialize sdk.
6262
6363``` js
6464type config = {
@@ -95,6 +95,7 @@ darkMode | Flag to enable dark mode | boolean | false |
9595onError | Callback for handling errors | (error: SirenErrorType)=> void | null |
9696onPress | Function for handling press of icon | ()=> void | null |
9797disabled | Flag to disable click handler of icon | boolean | false |
98+ hideBadge | Flag to hide unread notification count badge | boolean | false |
9899
99100#### Theming options
100101Customize the unread badge of the notification icon, and choose between dark and light theming options.
@@ -124,14 +125,16 @@ Customize the notification icon style properties includes size of icon, badge, e
124125 };
125126 badgeStyle?: {
126127 size?: number;
127- textSize?: number;
128+ textSize?: number;
129+ top?: number;
130+ right?: number;
128131 };
129132 }
130133```
131134
132135### 4. Siren Inbox
133136
134- SirenNotificationWindow is a paginated list view for displaying notifications.
137+ SirenNotificationInbox is a paginated list view for displaying notifications.
135138
136139``` js
137140import { SirenInbox } from ' @siren/react-native-inbox' ;
@@ -145,27 +148,42 @@ import { SirenInbox } from '@siren/react-native-inbox';
145148/ >
146149
147150```
148- #### Siren Notification Window Props
149- Given below are all props of window component.
151+ #### Siren Notification Inbox Props
152+ Given below are all props of inbox component.
150153
151154Prop | Description | Type | Default value |
152155--- | --- | --- | --- |
153- theme | Theme object for custom styling | Theme | {} |
154- title | Title of the notification window | string | "Notifications" |
156+ theme | Theme object for custom color theme | Theme | {} |
157+ customStyles | Style object for custom styling | StyleProps | {} |
158+ title | Title of the notification inbox | string | "Notifications" |
155159hideHeader | Flag to hide or show the header | boolean | false |
156160hideClearAll | Flag to hide or show the clear all button in header | boolean | false |
157161darkMode | Flag to enable dark mode | boolean | false |
162+ itemsPerFetch | Number of notifications fetch per api request (have a max cap of 50) | number | 20 |
158163cardProps | Props for customizing the notification cards | CardProps | null |
159164customNotificationCard | Custom function for rendering notification cards | (notification)=> JSX Element | null |
160165onNotificationCardClick | Props for customizing the notification cards | (notification)=> void | ()=>null |
161166listEmptyComponent | Custom component to display when the notification list is empty | JSX Element | null |
162167customHeader | Custom header component | JSX Element | null |
163168customFooter | Custom footer component | JSX Element | null |
169+ customLoader | Custom loader component | JSX Element | null |
170+ customErrorWindow | Custom error component | JSX Element | null |
164171onError | Callback for handling errors | (error: SirenErrorType)=> void | null |
165172
173+ #### Card props
174+
175+ Style object for customize notification card.
176+
177+ ``` js
178+ type CardProps = {
179+ hideAvatar?: boolean;
180+ showMedia?: boolean;
181+ };
182+ ```
183+
166184#### Theming options
167185
168- Customizable UI option for notification window , with dark and light theme options.
186+ Customizable UI option for notification inbox , with dark and light theme options.
169187
170188``` js
171189 type Theme = {
@@ -184,6 +202,7 @@ Customizable UI option for notification window, with dark and light theme option
184202 deleteIcon?: string;
185203 timerIcon?: string;
186204 clearAllIcon?: string;
205+ infiniteLoader?: string;
187206 };
188207 windowHeader?: {
189208 background?: string;
@@ -205,9 +224,9 @@ Customizable UI option for notification window, with dark and light theme option
205224 }
206225```
207226
208- #### Theming options
227+ #### Styling options
209228
210- Customizable Styling option for notification window .
229+ Customizable Styling option for notification inbox .
211230
212231``` js
213232 export type StyleProps = {
@@ -223,7 +242,6 @@ Customizable Styling option for notification window.
223242 titleFontWeight?: TextStyle[' fontWeight' ];
224243 titleSize?: number;
225244 closeIconSize?: number;
226- titlePadding?: number;
227245 }
228246 windowContainer?: {
229247 padding?: number;
@@ -234,14 +252,23 @@ Customizable Styling option for notification window.
234252 avatarSize?: number;
235253 titleFontWeight?: TextStyle[' fontWeight' ];
236254 titleSize?: number;
237- titlePadding?: number;
238255 descriptionSize?: number;
239- descriptionPadding?: number;
240256 dateSize?: number;
241257 };
242258 badgeStyle?: {
243259 size?: number;
244260 textSize?: number;
261+ top?: number;
262+ right?: number;
263+ };
264+ deleteIcon?: {
265+ size?: number
266+ };
267+ dateIcon?: {
268+ size?: number
269+ };
270+ clearAllIcon?: {
271+ size?: number
245272 };
246273 };
247274```
@@ -288,7 +315,7 @@ INVALID_RECIPIENT_ID | Invalid recipient id | Recipient id in provider is invali
288315TOKEN_VERIFICATION_FAILED | This operation requires a valid token | Failed to verify token and initialize sdk |
289316INVALID_ERROR_FUNCTION | Invalid error function | Error function is invalid |
290317GENERIC_API_ERROR | Api error | Failed to call a internal api |
291- SIREN_OBJECT_NOT_FOUND | Siren Object Not found | Was failed to initialize sdk, Siren object not created |
318+ OUTSIDE_SIREN_CONTEXT | Siren Object Not found | Was failed to initialize sdk, Siren object not created |
292319MISSING_PARAMETER | Missing Parameter | A parameter is missing in function call |
293320
294321### Complete Code Example
0 commit comments