1 | import "core-js/modules/es.object.assign.js";
|
2 |
|
3 | function _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 |
|
5 | import React from 'react';
|
6 | import { Consumer, useStorybookApi } from '@storybook/api';
|
7 | import NotificationList from '../components/notifications/NotificationList';
|
8 | export 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 |
|
21 | var NotificationConnect = function NotificationConnect(props) {
|
22 | return React.createElement(Consumer, {
|
23 | filter: mapper
|
24 | }, function (fromState) {
|
25 | return React.createElement(NotificationList, _extends({}, props, fromState));
|
26 | });
|
27 | };
|
28 |
|
29 | NotificationConnect.displayName = "NotificationConnect";
|
30 | export default NotificationConnect; |
\ | No newline at end of file |