Skip to content

Commit 3343b1e

Browse files
MaximeMailletferrao
authored andcommitted
Support for list item menu inside toast
1 parent 7e4c1b7 commit 3343b1e

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ toast(options, onClose, onClick);
9494
- `icon` - Override the default icon
9595
- `color` - Override color with [semantic values](https://react.semantic-ui.com/collections/message/#variations-color)
9696
- `size` - Size of toast with [semantic values](https://react.semantic-ui.com/collections/message/#variations-size)
97+
- `list` - Array of strings for showing an item menu inside the toast
9798
- `time` - Duration to keep the toast open, 0 to wait until closed by the user
9899
- `onClose` - The function that will be called when you click the toast is closed
99100
- `onClick` - The function that will be called when you click on the toast

lib/semantic-toast-container.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class SemanticToastContainer extends Component {
8282
time,
8383
size,
8484
color,
85+
list,
8586
onClick,
8687
animation
8788
} = toast;
@@ -95,6 +96,7 @@ class SemanticToastContainer extends Component {
9596
icon={icon}
9697
size={size}
9798
color={color}
99+
list={list}
98100
openAnimation={animation || containerAnimation || 'pulse'}
99101
closeAnimation={closeAnimations[position]}
100102
time={time}

lib/semantic-toast.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const icons = {
1111
};
1212

1313
function SemanticToast(props) {
14-
const { type, title, description, size, color, onClose, onClick } = props;
14+
const { type, title, description, size, color, list, onClose, onClick } = props;
1515
const icon = props.icon || icons[type];
1616

1717
const onDismiss = e => {
@@ -29,6 +29,7 @@ function SemanticToast(props) {
2929
icon={icon}
3030
size={size}
3131
color={color}
32+
list={list}
3233
floating
3334
/>
3435
);
@@ -45,6 +46,7 @@ SemanticToast.propTypes = {
4546
icon: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
4647
size: PropTypes.string,
4748
color: PropTypes.string,
49+
list: PropTypes.array,
4850
onClick: PropTypes.func,
4951
onClose: PropTypes.func
5052
};

0 commit comments

Comments
 (0)