Socket
Socket
Sign inDemoInstall

@mihanizm56/icons-loader

Package Overview
Dependencies
19
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mihanizm56/icons-loader

notifications module


Version published
Maintainers
1
Created

Readme

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

Last updated on 18 Feb 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc