Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wildberries/notifications

Package Overview
Dependencies
Maintainers
4
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wildberries/notifications

notifications module

  • 1.2.7
  • npm
  • Socket score

Version published
Weekly downloads
738
decreased by-24.07%
Maintainers
4
Weekly downloads
 
Created
Source

@wildberries/notifications

Build Status

Sollution for notifications, connected with redux

Examples of usage

Installation

npm install @wildberries/notifications

Connect to your root reducer

import {
  notificationsState,
  NOTIFICATIONS_REDUCER_NAME,
} from '@wildberries/notifications';

export const rootReducer = {
  [NOTIFICATIONS_REDUCER_NAME]: notificationsState,
  ...other root reducers
};

Insert the Notifications component into your project

import React, { memo } from "react";
import { Notifications } from "@wildberries/notifications";

const TestComponent = memo(() => (
    <div className="TestComponent">
        <Notifications />
    </div>
  );
})

Dispatch setModalAction to add notifications modal

SetModalAction params:
  • status - success | error - modal status (required)
  • text - string - modal test (required)
  • additionalPayload - string - payload of additional action if need to call from modal (not required)
  • additionalActionType - any - type of additional action if need to call from modal (not required)
import React from "react";
import { setModalAction } from "@wildberries/notifications";
import { useDispatch } from "react-redux";

function ExampleComponent() {
  const dispatch = useDispatch();

  const setModal = () => {
    dispatch(setModalAction({
      status: 'success',
      title: 'modal title',
      text: 'modal text',
      additionalPayload: { foo:'bar' }, 
      additionalActionType: 'SOME_TYPE',
    }))
  }

  return (
    <div className="ExampleComponent">
        <button onClick={setModal}>button</button>
    </div>
  );
}

export default App;

FAQs

Package last updated on 18 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc