mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
feature: toast of type info added
This commit is contained in:
parent
244fb8bf1b
commit
99b09fba17
2 changed files with 14 additions and 3 deletions
|
|
@ -9,7 +9,7 @@ const styles = require('./styles');
|
|||
|
||||
const ToastItem = ({ title, message, dataset, onSelect, onClose, ...props }) => {
|
||||
const type = React.useMemo(() => {
|
||||
return ['success', 'alert', 'error'].includes(props.type) ?
|
||||
return ['success', 'alert', 'info', 'error'].includes(props.type) ?
|
||||
props.type
|
||||
:
|
||||
'success';
|
||||
|
|
@ -18,7 +18,8 @@ const ToastItem = ({ title, message, dataset, onSelect, onClose, ...props }) =>
|
|||
return typeof props.icon === 'string' ? props.icon :
|
||||
type === 'success' ? 'checkmark' :
|
||||
type === 'error' ? 'warning' :
|
||||
null;
|
||||
type === 'info' ? 'about' :
|
||||
null;
|
||||
}, [type, props.icon]);
|
||||
const toastOnClick = React.useCallback((event) => {
|
||||
if (!event.nativeEvent.selectToastPrevented && typeof onSelect === 'function') {
|
||||
|
|
@ -81,7 +82,7 @@ const ToastItem = ({ title, message, dataset, onSelect, onClose, ...props }) =>
|
|||
};
|
||||
|
||||
ToastItem.propTypes = {
|
||||
type: PropTypes.oneOf(['success', 'alert', 'error']),
|
||||
type: PropTypes.oneOf(['success', 'alert', 'info', 'error']),
|
||||
title: PropTypes.string,
|
||||
message: PropTypes.string,
|
||||
icon: PropTypes.string,
|
||||
|
|
|
|||
|
|
@ -33,6 +33,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
&.info {
|
||||
.icon-container {
|
||||
background-color: @color-primary-light2;
|
||||
|
||||
.icon {
|
||||
color: @color-surface-light5-90;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon-container {
|
||||
flex: none;
|
||||
align-self: stretch;
|
||||
|
|
|
|||
Loading…
Reference in a new issue