GMFYNotifications
import { GMFYNotifications } from 'gmfy-sdk'
Motivation
Provider component for working with the list of user notifications with userId
.
It allows you to either get the list using hook.
Or you can pass the ID of the node where notifications will be displayed.
Properties
type GMFYNotificationsProps = {
notificationClassName?: string;
maxNumberToVisible?: number;
config?: {
updateInterval?: number;
portalId?: string;
showNotifications?: boolean;
};
}
notificationClassName
- the name of the style class that will be assigned to each of the notification cardsmaxNumberToVisible
- the maximum number of notification cards displayed at a timemaxNumberToVisible
- provider settings objectupdateInterval
- query call frequency in ms. If 0, then the request will be executed only once. Default 0portalId
- ID of the element in which to create a portal with a list of notifications. If no element with that ID is passed or found, thendocument.body
is selectedshowNotifications
- a flag responsible for whether received notifications will be displayed. Defaultfalse
Usage
<GMFYProvider config={config}>
<GMFYNotifications
showNotifications
maxNumberToVisible={4}
updateInterval={5000}
portalId="notifications-portal"
>
{/* your application */}
</GMFYNotifications>
</GMFYProvider>;
Display
The notification card displays
- information message
- icon to close the notification