How to use the @commercetools-frontend/actions-global.useShowNotification function in @commercetools-frontend/actions-global

To help you get started, weā€™ve selected a few @commercetools-frontend/actions-global examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifier / notifier.tsx View on Github external
const Notifier = (props: Props) => {
  const showNotification = globalActions.useShowNotification<
    Props & { id: number }
  >();

  React.useEffect(() => {
    const notification = showNotification(
      {
        id: 0,
        domain: props.domain,
        kind: props.kind,
        text: props.text,
      },
      isNumber(props.dismissAfter)
        ? { ...props.meta, dismissAfter: props.dismissAfter }
        : props.meta
    );
    return () => {