labyrinth-frontend/src/MessageBanner.js

18 lines
421 B
JavaScript
Raw Normal View History

import React from "react";
export default function MessageBanner({state, dispatch}) {
function handleClose() {
dispatch({
type: 'closed_message_banner'
})
}
if (!!state.errorMessage) {
return (<div className={"message-banner"}>
{state.errorMessage}
<button onClick={handleClose}>Dismiss message</button>
</div>);
}
return <></>;
}