Giter Club home page Giter Club logo

notifyme's Introduction

๐Ÿ”” react-notification-timeline

All Contributors

react-notification-timeline is a reactjs based component helps in managing the notifications in time-based manner. It is capable of keep tracking of the incoming notifications, manage read vs unread messages and allows many more customizations.

๐Ÿ”ฅ Why do you need this?

  • ๐Ÿ‘‰ Is your project is based on react js and you are looking for a time-based notification system?
  • ๐Ÿ‘‰ Do you want to keep track of the notifications in timed manner and manage them ?
  • ๐Ÿ‘‰ Do you want to structure the notifications in a cleaner way?
  • ๐Ÿ‘‰ Do you want to manage multi-line notifications?
  • ๐Ÿ‘‰ Do you limit the number of notifications you may want to see?

Then, you should give react-notification-timeline a try.

Here are some screen-shots

  • Notification Component with the unread message count

    notification
  • Notification Component with the messages as a pop-over

notification with messages

Live Demo

Netlify Status

A Live demo of the component is available here, ๐Ÿ’ป CLICK FOR DEMO

Many Thanks to all the Stargazers who has supported this project with stars(โญ)

Stargazers repo roster for @atapas/notifyme

โš’๏ธ How to use?

Install

You can install react-notification-timeline using npm or yarn.

npm i react-notification-timeline
yarn add react-notification-timeline

Import

Once installed, it can be imported into a react component as,

import NotifyMe from 'react-notification-timeline';

Usage

Here is an example usage,

<NotifyMe
  data={data}
  storageKey='notific_key'
  notific_key='timestamp'
  notific_value='update'
  heading='Notification Alerts'
  sortedByKey={false}
  showDate={true}
  size={64}
  color="yellow"
  markAsReadFn={() => yourOwnFunctionHandler()}
/>

Properties

CLICK ME to know the details of the properties

Property Description Required Example
theme customizing the background and foreground of the Notification and its icon No color and background color can be either in HexaCode,rgb or string name. Default is
   {
     color:"yellow",
     backgroundColor:"#282828"
   }
data Messages to show as notifications. This is expected to be an array of objects. Each of the object must have two properties.
  • timestamp: The timestamp of the time a message was generated. This must be a of a type long and represent a timestamp.
  • update: The message to show as notification.
Note: The keys names, timestamp and update can be customized as explained in other properties below.
Yes
   [
     {
       "update":"70 new employees are shifted",
       "timestamp":1596119688264
     },
     {
       "update":"Time to take a Break, TADA!!!",
       "timestamp":1596119686811
     }
   ]
heading A header message for the Notification panel. Pass a message to customize it. No Any string of your choice. Default value is, Notifications
multiLineSplitter In case a notification message has to be splitted into multiple (bullet) items, you can specify a line splitter character in-between. No Any Character like, # or a sequence of characters, #$#. Default value is, \n
notific_key Key in the data property that holds the timestamp value. Yes timestamp, attime or any string based key name in the data property.
notific_value key in the data property that holds the notification message value. Yes update, message or any string based key name in the data property.
showDate Notification message shows the date and time along with the message. Pass false for this property, if you do not want to show it. Pass true otherwise. No true or false. Default value is, false
size Size of the notification bell. Pass a Size to customize it. No Size values as, 16, 32, 48 etc. Default value is, 32
sortedByKey Pass true, if the data passed to this component is already sorted by time-based key. Pass false otherwise, the component will take care of the time based sorting. No true or false. Default value is, true
storageKey It stores the last read message key in localstorage of the browser. No Any string of your choice as a key. Default value is, notification_timeline_storage_id
markAsRead User can control the functionality of "Mark All As Read" by passing the function as prop as below markAsReadFn = {() => yourOwnFunctionHandler()} No Now "Mark All As Read" can be controlled by passing your own function as prop. Default functionality is,
  • We will clear the notification count.
  • Update the reactLocalStore with the latest notification key.
  • We will set the readIndex to 0 - which is used to highlight the unread notifications.
icon User can add custom notification Icon by passing react-feather icon as prop as below icon={IconName} //You need to import the Icon from the react-feather library No Any icon from the react-feather library default is Bell icon

๐Ÿท๏ธ License

Copyright ยฉ 2020 by Tapas Adhikary

This project is licensed under MIT license.

โญ Show your support

If you liked the work, please show your support by giving a Star!

โœ‹ Contributions

I would love to get your feedback. Please use the github issues for submitting any feedback. At the same time, please join hands in improving the component further by fixing bugs, adding features.

People contributed so far (emoji key):


Tapas Adhikary

๐Ÿš‡ โš ๏ธ ๐Ÿ’ป

NagarjunShroff

๐Ÿ’ป

Sankalpa Fernando

๐Ÿ’ป

Dony M Varkey

๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

notifyme's People

Contributors

allcontributors[bot] avatar atapas avatar dependabot[bot] avatar donymvarkey avatar nagarjunshroff avatar sankalpafernando avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

notifyme's Issues

Language support

It would be great if there was language support for these text: "Mark all as read" and "... second(s)/minute(s)/hour(s) before"

I can not able to install react-notification-timeline

React version: 17.0.1

I found this error on the terminal

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: @pancakeswap/interface@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.12.0" from [email protected]
npm ERR! node_modules/react-notification-timeline
npm ERR!   react-notification-timeline@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/mif/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mif/.npm/_logs/2021-07-10T12_48_53_128Z-debug.log

By using your code, I'm getting dependencies error. Please give me a solution.

D:\notifyme-master>npm i [email protected]
npm WARN deprecated [email protected]: ๐Ÿ™Œ Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (debug-js/debug#797)
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! code 1
npm ERR! path D:\notifyme-master\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe D:\notifyme-master\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'C:\Program Files\nodejs\node.exe',
npm ERR! gyp verb cli 'D:\notifyme-master\node_modules\node-gyp\bin\node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb which failed Error: not found: python2
npm ERR! gyp verb which failed at getNotFoundError (D:\notifyme-master\node_modules\which\which.js:13:12)
npm ERR! gyp verb which failed at F (D:\notifyme-master\node_modules\which\which.js:68:19)
npm ERR! gyp verb which failed at E (D:\notifyme-master\node_modules\which\which.js:80:29)
npm ERR! gyp verb which failed at D:\notifyme-master\node_modules\which\which.js:89:16
npm ERR! gyp verb which failed at D:\notifyme-master\node_modules\isexe\index.js:42:5
npm ERR! gyp verb which failed at D:\notifyme-master\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb which failed at FSReqCallback.oncomplete (node:fs:200:21)
npm ERR! gyp verb which failed python2 Error: not found: python2
npm ERR! gyp verb which failed at getNotFoundError (D:\notifyme-master\node_modules\which\which.js:13:12)
npm ERR! gyp verb which failed at F (D:\notifyme-master\node_modules\which\which.js:68:19)
npm ERR! gyp verb which failed at E (D:\notifyme-master\node_modules\which\which.js:80:29)
npm ERR! gyp verb which failed at D:\notifyme-master\node_modules\which\which.js:89:16
npm ERR! gyp verb which failed at D:\notifyme-master\node_modules\isexe\index.js:42:5
npm ERR! gyp verb which failed at D:\notifyme-master\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb which failed at FSReqCallback.oncomplete (node:fs:200:21) {
npm ERR! gyp verb which failed code: 'ENOENT'
npm ERR! gyp verb which failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb which succeeded python C:\Python39\python.EXE
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:326:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:378:20)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1067:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\notifyme-master\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd D:\notifyme-master\node_modules\node-sass
npm ERR! gyp ERR! node -v v15.11.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Lenovo\AppData\Local\npm-cache_logs\2021-04-02T13_55_05_376Z-debug.log

landing page

in landing page the buttons are not aligned correctly

Add Mark All as Read button as a prop

Able to access the button Mark All as Read from prop gives a chance to control data.
The Problem : Updating data using useState in React causing the entire component to re-render. If we can get the controll over Mark All as Read Button, we can delete data accordingly using localStorage.

Replace color prop by theme prop

Instead of using a color prop that can only configure the icon color, add a prop called theme that can configure both foreground and background.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.