Skip to content

Instantly share code, notes, and snippets.

@codeBelt
Created November 9, 2019 22:12
Show Gist options
  • Save codeBelt/69e21dc14df2b902acabacad63fc38f2 to your computer and use it in GitHub Desktop.
Save codeBelt/69e21dc14df2b902acabacad63fc38f2 to your computer and use it in GitHub Desktop.
export default function ToastCard(props) {
const dispatch = useDispatch();
const onClickRemoveNotification = useCallback(
(event, data) => {
dispatch(ToastsAction.removeById(props.item.id));
},
[dispatch, props.item.id]
);
const buttonColor = buttonColorMap[props.item.type];
return (
<Card key={props.item.id}>
<Card.Content>
<Card.Header content={props.item.type} />
<Card.Description content={props.item.message} />
</Card.Content>
<Card.Content extra={true}>
<Button color={buttonColor} onClick={onClickRemoveNotification}>
Close
</Button>
</Card.Content>
</Card>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment