@arcblock/ux 2.0.7 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ClickToCopy/index.js +7 -6
- package/lib/Toast/index.js +62 -125
- package/package.json +5 -4
- package/src/ClickToCopy/index.js +22 -18
- package/src/Toast/index.js +53 -102
package/lib/ClickToCopy/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
|
19
19
|
|
|
20
20
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
21
21
|
|
|
22
|
-
var _Toast =
|
|
22
|
+
var _Toast = _interopRequireWildcard(require("../Toast"));
|
|
23
23
|
|
|
24
24
|
var _Util = require("../Util");
|
|
25
25
|
|
|
@@ -59,6 +59,10 @@ function ClickToCopy(props) {
|
|
|
59
59
|
const onCopy = e => {
|
|
60
60
|
(0, _copyToClipboard.default)(content || e.current.textContent);
|
|
61
61
|
setCopied(true);
|
|
62
|
+
|
|
63
|
+
if (width < 600) {
|
|
64
|
+
_Toast.default.success(copiedTip);
|
|
65
|
+
}
|
|
62
66
|
};
|
|
63
67
|
|
|
64
68
|
(0, _react.useEffect)(() => {
|
|
@@ -76,7 +80,7 @@ function ClickToCopy(props) {
|
|
|
76
80
|
}
|
|
77
81
|
};
|
|
78
82
|
});
|
|
79
|
-
return /*#__PURE__*/_react.default.createElement(_Tooltip.default, Object.assign({
|
|
83
|
+
return /*#__PURE__*/_react.default.createElement(_Toast.ToastProvider, null, /*#__PURE__*/_react.default.createElement(_Tooltip.default, Object.assign({
|
|
80
84
|
title: copied ? copiedTip : tip
|
|
81
85
|
}, rest, {
|
|
82
86
|
placement: tipPlacement,
|
|
@@ -90,10 +94,7 @@ function ClickToCopy(props) {
|
|
|
90
94
|
fontWeight: 'inherit'
|
|
91
95
|
}, style),
|
|
92
96
|
onClick: () => onCopy(childrenRef)
|
|
93
|
-
}, children || content
|
|
94
|
-
variant: "success",
|
|
95
|
-
message: copiedTip
|
|
96
|
-
})));
|
|
97
|
+
}, children || content)));
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
ClickToCopy.propTypes = {
|
package/lib/Toast/index.js
CHANGED
|
@@ -3,157 +3,94 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.ToastProvider = ToastProvider;
|
|
7
|
+
exports.default = void 0;
|
|
7
8
|
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _CheckCircle = _interopRequireDefault(require("@mui/icons-material/CheckCircle"));
|
|
13
|
-
|
|
14
|
-
var _Error = _interopRequireDefault(require("@mui/icons-material/Error"));
|
|
15
|
-
|
|
16
|
-
var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
|
|
17
|
-
|
|
18
|
-
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
19
|
-
|
|
20
|
-
var _Warning = _interopRequireDefault(require("@mui/icons-material/Warning"));
|
|
11
|
+
var _notistack = require("notistack");
|
|
21
12
|
|
|
22
13
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
23
14
|
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
var _SnackbarContent = _interopRequireDefault(require("@mui/material/SnackbarContent"));
|
|
27
|
-
|
|
28
|
-
var _colors = require("@mui/material/colors");
|
|
29
|
-
|
|
30
|
-
var _styles = require("@mui/styles");
|
|
31
|
-
|
|
32
|
-
const _excluded = ["className", "message", "onClose", "variant"];
|
|
15
|
+
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
33
16
|
|
|
34
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
18
|
|
|
36
|
-
function
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
20
|
|
|
38
|
-
function
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
22
|
|
|
40
|
-
|
|
41
|
-
success: _CheckCircle.default,
|
|
42
|
-
warning: _Warning.default,
|
|
43
|
-
error: _Error.default,
|
|
44
|
-
info: _Info.default
|
|
45
|
-
};
|
|
46
|
-
const useStyles1 = (0, _styles.makeStyles)(theme => ({
|
|
47
|
-
success: {
|
|
48
|
-
backgroundColor: _colors.green[600]
|
|
49
|
-
},
|
|
50
|
-
error: {
|
|
51
|
-
backgroundColor: theme.palette.error.dark
|
|
52
|
-
},
|
|
53
|
-
info: {
|
|
54
|
-
backgroundColor: theme.palette.primary.main
|
|
55
|
-
},
|
|
56
|
-
warning: {
|
|
57
|
-
backgroundColor: _colors.amber[700]
|
|
58
|
-
},
|
|
59
|
-
icon: {
|
|
60
|
-
fontSize: 20
|
|
61
|
-
},
|
|
62
|
-
iconVariant: {
|
|
63
|
-
opacity: 0.9,
|
|
64
|
-
marginRight: theme.spacing(1)
|
|
65
|
-
},
|
|
66
|
-
message: {
|
|
67
|
-
display: 'flex',
|
|
68
|
-
alignItems: 'center'
|
|
69
|
-
}
|
|
70
|
-
}));
|
|
23
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
71
24
|
|
|
72
|
-
|
|
73
|
-
const classes = useStyles1();
|
|
25
|
+
const noop = () => {};
|
|
74
26
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
27
|
+
let _success = noop;
|
|
28
|
+
let _error = noop;
|
|
29
|
+
let _warning = noop;
|
|
30
|
+
let _info = noop;
|
|
31
|
+
|
|
32
|
+
const genFn = (enqueueSnackbar, variant) => (message, opts) => {
|
|
33
|
+
enqueueSnackbar(message, _objectSpread({
|
|
34
|
+
autoHideDuration: 3000,
|
|
79
35
|
variant
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const Icon = variantIcon[variant];
|
|
84
|
-
return /*#__PURE__*/_react.default.createElement(_SnackbarContent.default, Object.assign({
|
|
85
|
-
className: [classes[variant], className].join(' ').trim(),
|
|
86
|
-
message: /*#__PURE__*/_react.default.createElement("span", {
|
|
87
|
-
id: "client-snackbar",
|
|
88
|
-
className: classes.message
|
|
89
|
-
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
90
|
-
className: [classes.icon, classes.iconVariant].join(' ').trim()
|
|
91
|
-
}), message),
|
|
92
|
-
action: [/*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
93
|
-
key: "close",
|
|
94
|
-
"aria-label": "close",
|
|
95
|
-
color: "inherit",
|
|
96
|
-
onClick: onClose,
|
|
97
|
-
size: "large"
|
|
98
|
-
}, /*#__PURE__*/_react.default.createElement(_Close.default, {
|
|
99
|
-
className: classes.icon
|
|
100
|
-
}))]
|
|
101
|
-
}, rest));
|
|
102
|
-
}
|
|
36
|
+
}, opts));
|
|
37
|
+
}; // eslint-disable-next-line react/prop-types
|
|
103
38
|
|
|
104
|
-
SnackbarContentWrapper.propTypes = {
|
|
105
|
-
message: _propTypes.default.string.isRequired,
|
|
106
|
-
onClose: _propTypes.default.func.isRequired,
|
|
107
|
-
className: _propTypes.default.string,
|
|
108
|
-
variant: _propTypes.default.oneOf(['error', 'info', 'success', 'warning'])
|
|
109
|
-
};
|
|
110
|
-
SnackbarContentWrapper.defaultProps = {
|
|
111
|
-
className: '',
|
|
112
|
-
variant: 'success'
|
|
113
|
-
};
|
|
114
39
|
|
|
115
|
-
function
|
|
40
|
+
function ToastProvider(_ref) {
|
|
116
41
|
let {
|
|
117
|
-
|
|
118
|
-
variant,
|
|
119
|
-
duration,
|
|
120
|
-
message
|
|
42
|
+
children
|
|
121
43
|
} = _ref;
|
|
122
44
|
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
const handleClose = (e, reason) => {
|
|
126
|
-
if (reason === 'clickaway') {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
45
|
+
const notistackRef = /*#__PURE__*/_react.default.createRef();
|
|
129
46
|
|
|
130
|
-
|
|
131
|
-
|
|
47
|
+
const onClickDismiss = key => () => {
|
|
48
|
+
notistackRef.current.closeSnackbar(key);
|
|
132
49
|
};
|
|
133
50
|
|
|
134
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
135
|
-
open: open,
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_notistack.SnackbarProvider, {
|
|
136
52
|
anchorOrigin: {
|
|
137
53
|
vertical: 'top',
|
|
138
54
|
horizontal: 'right'
|
|
139
55
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
56
|
+
ref: notistackRef,
|
|
57
|
+
action: key => /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
58
|
+
key: "close",
|
|
59
|
+
"aria-label": "close",
|
|
60
|
+
color: "inherit",
|
|
61
|
+
onClick: onClickDismiss(key),
|
|
62
|
+
size: "large"
|
|
63
|
+
}, /*#__PURE__*/_react.default.createElement(_Close.default, {
|
|
64
|
+
style: {
|
|
65
|
+
fontSize: 16
|
|
66
|
+
}
|
|
67
|
+
}))
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement(Toast, null), children);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function Toast() {
|
|
72
|
+
const {
|
|
73
|
+
enqueueSnackbar
|
|
74
|
+
} = (0, _notistack.useSnackbar)();
|
|
75
|
+
_success = genFn(enqueueSnackbar, 'success');
|
|
76
|
+
_error = genFn(enqueueSnackbar, 'error');
|
|
77
|
+
_warning = genFn(enqueueSnackbar, 'warning');
|
|
78
|
+
_info = genFn(enqueueSnackbar, 'info');
|
|
79
|
+
return null;
|
|
147
80
|
}
|
|
148
81
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
82
|
+
var _default = {
|
|
83
|
+
success: function success() {
|
|
84
|
+
return _success(...arguments);
|
|
85
|
+
},
|
|
86
|
+
error: function error() {
|
|
87
|
+
return _error(...arguments);
|
|
88
|
+
},
|
|
89
|
+
warning: function warning() {
|
|
90
|
+
return _warning(...arguments);
|
|
91
|
+
},
|
|
92
|
+
info: function info() {
|
|
93
|
+
return _info(...arguments);
|
|
94
|
+
}
|
|
154
95
|
};
|
|
155
|
-
|
|
156
|
-
variant: 'success',
|
|
157
|
-
duration: 3000,
|
|
158
|
-
onClose: () => {}
|
|
159
|
-
};
|
|
96
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"react": ">=18.1.0",
|
|
53
53
|
"react-ga": "^2.7.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "e3e53508384f1681546b29d7ad6a10d92c371239",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@arcblock/icons": "^2.0
|
|
58
|
-
"@arcblock/react-hooks": "^2.0
|
|
57
|
+
"@arcblock/icons": "^2.1.0",
|
|
58
|
+
"@arcblock/react-hooks": "^2.1.0",
|
|
59
59
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
60
60
|
"@emotion/react": "^11.9.0",
|
|
61
61
|
"@emotion/styled": "^11.8.1",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"js-cookie": "^2.2.0",
|
|
76
76
|
"lodash": "^4.17.21",
|
|
77
77
|
"mdi-material-ui": "^7.2.0",
|
|
78
|
+
"notistack": "^2.0.5",
|
|
78
79
|
"react-cookie-consent": "^6.4.1",
|
|
79
80
|
"react-helmet": "^6.1.0",
|
|
80
81
|
"react-intersection-observer": "^8.31.1",
|
package/src/ClickToCopy/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import Tooltip from '@mui/material/Tooltip';
|
|
|
7
7
|
import Typography from '@mui/material/Typography';
|
|
8
8
|
import styled from 'styled-components';
|
|
9
9
|
|
|
10
|
-
import Toast from '../Toast';
|
|
10
|
+
import Toast, { ToastProvider } from '../Toast';
|
|
11
11
|
import { mergeProps } from '../Util';
|
|
12
12
|
|
|
13
13
|
export default function ClickToCopy(props) {
|
|
@@ -21,6 +21,9 @@ export default function ClickToCopy(props) {
|
|
|
21
21
|
const onCopy = e => {
|
|
22
22
|
Copy(content || e.current.textContent);
|
|
23
23
|
setCopied(true);
|
|
24
|
+
if (width < 600) {
|
|
25
|
+
Toast.success(copiedTip);
|
|
26
|
+
}
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
useEffect(() => {
|
|
@@ -39,23 +42,24 @@ export default function ClickToCopy(props) {
|
|
|
39
42
|
});
|
|
40
43
|
|
|
41
44
|
return (
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
<ToastProvider>
|
|
46
|
+
<Tooltip
|
|
47
|
+
title={copied ? copiedTip : tip}
|
|
48
|
+
{...rest}
|
|
49
|
+
placement={tipPlacement}
|
|
50
|
+
disableFocusListener>
|
|
51
|
+
<Container
|
|
52
|
+
ref={childrenRef}
|
|
53
|
+
component="span"
|
|
54
|
+
style={Object.assign(
|
|
55
|
+
{ fontSize: 'inherit', color: 'inherit', fontWeight: 'inherit' },
|
|
56
|
+
style
|
|
57
|
+
)}
|
|
58
|
+
onClick={() => onCopy(childrenRef)}>
|
|
59
|
+
{children || content}
|
|
60
|
+
</Container>
|
|
61
|
+
</Tooltip>
|
|
62
|
+
</ToastProvider>
|
|
59
63
|
);
|
|
60
64
|
}
|
|
61
65
|
|
package/src/Toast/index.js
CHANGED
|
@@ -1,118 +1,69 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
|
5
|
-
import ErrorIcon from '@mui/icons-material/Error';
|
|
6
|
-
import InfoIcon from '@mui/icons-material/Info';
|
|
7
|
-
import CloseIcon from '@mui/icons-material/Close';
|
|
8
|
-
import WarningIcon from '@mui/icons-material/Warning';
|
|
2
|
+
import { SnackbarProvider, useSnackbar } from 'notistack';
|
|
9
3
|
import IconButton from '@mui/material/IconButton';
|
|
10
|
-
import
|
|
11
|
-
import SnackbarContent from '@mui/material/SnackbarContent';
|
|
12
|
-
import { amber, green } from '@mui/material/colors';
|
|
13
|
-
import { makeStyles } from '@mui/styles';
|
|
4
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
14
5
|
|
|
15
|
-
const
|
|
16
|
-
success: CheckCircleIcon,
|
|
17
|
-
warning: WarningIcon,
|
|
18
|
-
error: ErrorIcon,
|
|
19
|
-
info: InfoIcon,
|
|
20
|
-
};
|
|
6
|
+
const noop = () => {};
|
|
21
7
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
error: {
|
|
27
|
-
backgroundColor: theme.palette.error.dark,
|
|
28
|
-
},
|
|
29
|
-
info: {
|
|
30
|
-
backgroundColor: theme.palette.primary.main,
|
|
31
|
-
},
|
|
32
|
-
warning: {
|
|
33
|
-
backgroundColor: amber[700],
|
|
34
|
-
},
|
|
35
|
-
icon: {
|
|
36
|
-
fontSize: 20,
|
|
37
|
-
},
|
|
38
|
-
iconVariant: {
|
|
39
|
-
opacity: 0.9,
|
|
40
|
-
marginRight: theme.spacing(1),
|
|
41
|
-
},
|
|
42
|
-
message: {
|
|
43
|
-
display: 'flex',
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
},
|
|
46
|
-
}));
|
|
8
|
+
let success = noop;
|
|
9
|
+
let error = noop;
|
|
10
|
+
let warning = noop;
|
|
11
|
+
let info = noop;
|
|
47
12
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
13
|
+
const genFn = (enqueueSnackbar, variant) => (message, opts) => {
|
|
14
|
+
enqueueSnackbar(message, {
|
|
15
|
+
autoHideDuration: 3000,
|
|
16
|
+
variant,
|
|
17
|
+
...opts,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// eslint-disable-next-line react/prop-types
|
|
22
|
+
function ToastProvider({ children }) {
|
|
23
|
+
const notistackRef = React.createRef();
|
|
24
|
+
const onClickDismiss = key => () => {
|
|
25
|
+
notistackRef.current.closeSnackbar(key);
|
|
26
|
+
};
|
|
52
27
|
|
|
53
28
|
return (
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
29
|
+
<SnackbarProvider
|
|
30
|
+
anchorOrigin={{
|
|
31
|
+
vertical: 'top',
|
|
32
|
+
horizontal: 'right',
|
|
33
|
+
}}
|
|
34
|
+
ref={notistackRef}
|
|
35
|
+
action={key => (
|
|
36
|
+
<IconButton
|
|
37
|
+
key="close"
|
|
38
|
+
aria-label="close"
|
|
39
|
+
color="inherit"
|
|
40
|
+
onClick={onClickDismiss(key)}
|
|
41
|
+
size="large">
|
|
42
|
+
<CloseIcon style={{ fontSize: 16 }} />
|
|
43
|
+
</IconButton>
|
|
44
|
+
)}>
|
|
45
|
+
<Toast />
|
|
46
|
+
{children}
|
|
47
|
+
</SnackbarProvider>
|
|
69
48
|
);
|
|
70
49
|
}
|
|
71
50
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
onClose: PropTypes.func.isRequired,
|
|
75
|
-
className: PropTypes.string,
|
|
76
|
-
variant: PropTypes.oneOf(['error', 'info', 'success', 'warning']),
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
SnackbarContentWrapper.defaultProps = {
|
|
80
|
-
className: '',
|
|
81
|
-
variant: 'success',
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export default function Toast({ onClose, variant, duration, message }) {
|
|
85
|
-
const [open, setOpen] = React.useState(true);
|
|
86
|
-
|
|
87
|
-
const handleClose = (e, reason) => {
|
|
88
|
-
if (reason === 'clickaway') {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
51
|
+
function Toast() {
|
|
52
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
91
53
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
54
|
+
success = genFn(enqueueSnackbar, 'success');
|
|
55
|
+
error = genFn(enqueueSnackbar, 'error');
|
|
56
|
+
warning = genFn(enqueueSnackbar, 'warning');
|
|
57
|
+
info = genFn(enqueueSnackbar, 'info');
|
|
95
58
|
|
|
96
|
-
return
|
|
97
|
-
<Snackbar
|
|
98
|
-
open={open}
|
|
99
|
-
anchorOrigin={{ vertical: 'top', horizontal: 'right' }}
|
|
100
|
-
autoHideDuration={duration}
|
|
101
|
-
onClose={handleClose}>
|
|
102
|
-
<SnackbarContentWrapper onClose={handleClose} variant={variant} message={message} />
|
|
103
|
-
</Snackbar>
|
|
104
|
-
);
|
|
59
|
+
return null;
|
|
105
60
|
}
|
|
106
61
|
|
|
107
|
-
|
|
108
|
-
message: PropTypes.string.isRequired,
|
|
109
|
-
variant: PropTypes.string,
|
|
110
|
-
duration: PropTypes.number,
|
|
111
|
-
onClose: PropTypes.func,
|
|
112
|
-
};
|
|
62
|
+
export { ToastProvider };
|
|
113
63
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
64
|
+
export default {
|
|
65
|
+
success: (...args) => success(...args),
|
|
66
|
+
error: (...args) => error(...args),
|
|
67
|
+
warning: (...args) => warning(...args),
|
|
68
|
+
info: (...args) => info(...args),
|
|
118
69
|
};
|