1.0.0-alpha.29 • Published 19 hours ago

@concepta/react-notification-provider v1.0.0-alpha.29

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
19 hours ago

@rockets-react/notification-provider

Rockets Notification package to handle all notifications you may need in your application.

IMPORTANT

When building your notification system, you need to remember these!

This module only helps you to handle notification on your application. There is no magic, you are still responsible for having a Notification component and maitaing the state and notification messages of your application.

Here is how it works

This package will expose the following

  • A provider and a hook to access notification information like title, message and messageType and to create new notifications

Examples

These are very rough examples. We intend to improve them ASAP.

Simple User Login

import { useAuth } from "@concepta/auth-provider";
import { NotificationProvider, useNotification } from "@concepta/notification-provider";

const LoginForm = () => {
  const {doLogin, user } = useAuth();
  const {notification, notify} = useNotification();

  React.useEffect(()=>{
    if(user){
      notify({
        title: 'Success',
        message: 'Login Success',
        messageType: 'success',
      })
    }
  }, [user])

  const onClickSignIn = async (user: string, password: string) => {
    doLogin({ email: user, password });
  }

  return <>
    <SimpleLoginForm onClickSignIn={onClickSignIn} />;
    {notification && <Notification {...notification}>}
  </>
}

const AppWrapper: React.FC = () => {
  return
  <NotificationProvider>
    <LoginForm />
  </NotificationProvider>
}
1.0.0-alpha.29

19 hours ago

1.0.0-alpha.28

1 month ago

1.0.0-alpha.27

1 month ago

1.0.0-alpha.26

3 months ago

1.0.0-alpha.25

3 months ago

1.0.0-alpha.24

3 months ago

1.0.0-alpha.23

4 months ago

1.0.0-alpha.22

4 months ago

1.0.0-alpha.21

4 months ago

1.0.0-alpha.20

5 months ago

1.0.0-alpha.19

5 months ago

1.0.0-alpha.18

5 months ago

1.0.0-alpha.17

5 months ago

1.0.0-alpha.16

5 months ago

1.0.0-alpha.12.1

6 months ago

1.0.0-alpha.8

7 months ago

1.0.0-alpha.7

8 months ago

1.0.0-alpha.6

8 months ago

1.0.0-alpha.10

7 months ago

1.0.0-alpha.15

6 months ago

1.0.0-alpha.12

6 months ago

1.0.0-alpha.11

6 months ago

1.0.0-alpha.14

6 months ago

1.0.0-alpha.13

6 months ago

1.0.0-alpha.5

1 year ago

1.0.0-alpha.3

1 year ago

1.0.0-alpha.2

1 year ago

1.0.0-alpha.1

2 years ago