Plurall Notifications
Componente React para listar notificações do Plurall
Para rodar
yarn install
yarn start
Agora pode abrir localhost:6006 para testar o componente visualmente
Para Buildar
yarn build
Como Usar
- Inserir no root da aplicação o provider de notificação
- Inserir no root da aplicação o componente
import {
Notifications,
NotificationsProvider,
useNotificationsPublicContext,
NotificationIcon // caso a prop <Notifications icon={false} /> é possível utiliza o componente trigger <NotificationIcon />
} from '@plurall/notifications'
const {
setOpen, // function que abre/fecha a central de notificação
loading, // boolean que indica se o estado da central (requests) está em processo de loading
badge, // boolean que indica se há novas notificações
open, // boolean que indica se a central de notificações está aberta
} = useNotificationsPublicContext()
<NotificationsProvider
// Config API Auth Firebase Token
msApiURL={'Url da API de comunicações'}
userToken={'Token do usuário logado'}
// Config Firebase
apiKey={'Chave do firebase'}
authDomain={'Url de auth do firebase'}
projectId={'Porject ID do firebase'}
storageBucket={'Chave de config. do firebase'}
messagingSenderId={'Chave de config. do firebase'}
appId={'Chave de config. do firebase'}
measurementId={'Chave de config. do firebase'}
>
<Notifications />
</NotificationsProvider>