Created
November 9, 2019 22:12
-
-
Save codeBelt/69e21dc14df2b902acabacad63fc38f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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