@@ -16,34 +37,29 @@ const Toast = ({ type, title, text, icon, closeButton, onClick, onClose }) => {
:
null
}
-
+
{
typeof title === 'string' && title.length > 0 ?
-
{title}
+
{title}
:
null
}
- {text}
+
{message}
- {
- closeButton ?
-
- :
- null
- }
-
+
+
);
};
Toast.propTypes = {
- type: PropTypes.string,
+ type: PropTypes.oneOf(['success', 'alert', 'error']),
title: PropTypes.string,
- text: PropTypes.string,
+ message: PropTypes.string,
icon: PropTypes.string,
- closeButton: PropTypes.bool,
- onClick: PropTypes.func,
+ dataset: PropTypes.objectOf(PropTypes.string),
+ onSelect: PropTypes.func,
onClose: PropTypes.func
};
diff --git a/src/common/Toasts/Toast/index.js b/src/common/Toasts/Toast/index.js
index efe31724b..37050e200 100644
--- a/src/common/Toasts/Toast/index.js
+++ b/src/common/Toasts/Toast/index.js
@@ -1,3 +1,3 @@
const Toast = require('./Toast');
-module.exports = Toast;
\ No newline at end of file
+module.exports = Toast;
diff --git a/src/common/Toasts/Toast/styles.less b/src/common/Toasts/Toast/styles.less
index 6bb5c6399..41ff0ca39 100644
--- a/src/common/Toasts/Toast/styles.less
+++ b/src/common/Toasts/Toast/styles.less
@@ -2,13 +2,14 @@
display: flex;
flex-direction: row;
min-height: 6rem;
+ max-width: 25rem;
margin-bottom: 1rem;
border: thin solid;
- color: var(--color-backgrounddarker);
- fill: var(--color-backgrounddarker);
background-color: var(--color-surfacelighter);
overflow: visible;
- pointer-events: all;
+ box-shadow: 0 0.3rem 0.5rem var(--color-backgrounddarker40),
+ 0 0.6rem 1rem var(--color-backgrounddarker20);
+ pointer-events: auto;
&.success {
color: var(--color-signal5);
@@ -26,10 +27,10 @@
}
.icon-container {
- width: 5rem;
- padding: 1rem;
- padding-right: 0;
- overflow: visible;
+ flex: none;
+ align-self: stretch;
+ width: 4.5rem;
+ padding: 1.2rem 0 1.2rem 1.2rem;
.icon {
display: block;
@@ -38,33 +39,35 @@
}
}
- .message-container {
+ .info-container {
flex: 1;
+ align-self: stretch;
padding: 1rem;
- &.clickable {
- cursor: pointer;
+ .title-container {
+ font-size: 1.2rem;
}
- .message-caption {
- font-weight: bold;
+ .message-container {
+ font-size: 1.1rem;
}
}
.close-button-container {
flex: none;
+ align-self: flex-start;
width: 3rem;
height: 3rem;
padding: 1rem;
+ &:hover {
+ background-color: var(--color-surfacelight);
+ }
+
.icon {
display: block;
width: 100%;
height: 100%;
}
-
- &:hover {
- background-color: var(--color-surfacelight);
- }
}
}
\ No newline at end of file