UNPKG

1.21 kBJavaScriptView Raw
1import "core-js/modules/es.object.assign.js";
2
3function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
5import React from 'react';
6import { Consumer, useStorybookApi } from '@storybook/api';
7import NotificationList from '../components/notifications/NotificationList';
8export var mapper = function mapper(_ref) {
9 var state = _ref.state;
10
11 var _useStorybookApi = useStorybookApi(),
12 clearNotification = _useStorybookApi.clearNotification;
13
14 var notifications = state.notifications;
15 return {
16 notifications: notifications,
17 clearNotification: clearNotification
18 };
19};
20
21var NotificationConnect = function NotificationConnect(props) {
22 return /*#__PURE__*/React.createElement(Consumer, {
23 filter: mapper
24 }, function (fromState) {
25 return /*#__PURE__*/React.createElement(NotificationList, _extends({}, props, fromState));
26 });
27};
28
29NotificationConnect.displayName = "NotificationConnect";
30export default NotificationConnect;
\No newline at end of file