cf-component-notifications
Cloudflare Notifications Component
Installation
Installation with yarn is recommended
$ yarn add cf-component-notifications
Usage
import React from 'react';import NotificationList Notification NotificationGlobalContainer from 'cf-component-notifications';import Button from 'cf-component-button'; let UNIQUE_ID = 0; Component { ; thisstate = notifications: ; } { const id = UNIQUE_ID++; this; } { this; } { this; } { const notifications = thisstatenotifications ; return <div> <Button ="danger" = > Add Error Notification </Button> <Button ="warning" = > Add Warning Notification </Button> <Button ="success" = > Add Success Notification </Button> <Button ="primary" = > Add Info Notification </Button> <Button ="primary" = > Add 10000ms Notification </Button> <Button ="primary" = > Add Persistant Notification </Button> <Button ="default" => Clear Notifications </Button> <p> `NOTE: When passing a key to <Notification/> above, note that this must be a unique id that does not change in between renders. Do not use the index of the map function.` </p> <NotificationGlobalContainer> <NotificationList>notifications</NotificationList> </NotificationGlobalContainer> </div> ; } ;