Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Add useNotification hook #44

Open
6 tasks
m10rten opened this issue Jul 12, 2023 · 1 comment · May be fixed by #50
Open
6 tasks

[FEAT] Add useNotification hook #44

m10rten opened this issue Jul 12, 2023 · 1 comment · May be fixed by #50
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@m10rten
Copy link
Contributor

m10rten commented Jul 12, 2023

Description
To add a hook that allows usage of the built in notification system: mozilla

Acceptance Criteria

  • Allows for title input
  • Allows for description input
  • Allows for image input
  • Needs to check permissions with Notification.permission
  • All other notification properties, specified on mozilla docs.
  • Returns the events from the notification (close, click, error, show, etc.)

Example usage

import { useNotification } from "react-haiku";

//... component
const { show, close } = useNotification({
  title: "Test Notification",
  //... more properties here
});

//... in button for example:
onClick={() => {
  show();
}}
//... close component

the hook will either show the notification or not at all if the permission is denied.

We could also return the permission status: 'denied' | 'granted' | 'loading' | 'default'

@m10rten m10rten added the enhancement New feature or request label Jul 12, 2023
@plbstl plbstl linked a pull request Jul 15, 2023 that will close this issue
@DavidHDev DavidHDev added the good first issue Good for newcomers label Jul 16, 2023
@youngancient
Copy link

Hey @DavidHDev Pls assign this issue to me, I would like to work on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants