Locaft/src/components/ErrorNotice.js

53 lines
980 B
JavaScript
Raw Normal View History

2021-03-17 18:44:15 -07:00
import React from "react";
import styled from 'styled-components';
export default function ErrorNotice(props) {
const ErrorNotice = styled.div`
margin: 1rem 0;
border: 1px solid #e07c7c;
border-radius: 8px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #f8d6d6;
2021-03-31 11:24:24 -07:00
padding: 10px;
2021-03-17 18:44:15 -07:00
`;
const ErrorMessage = styled.div`
color: #000000;
`;
2021-03-31 11:24:24 -07:00
const ErrorButton = styled.a
2021-03-17 18:44:15 -07:00
`
2021-03-31 11:24:24 -07:00
color: red;
position: relative;
width: 20px;
height: 20px;
opacity: 0.3;
&:hover {
opacity: 1;
}
&:before, &:after {
position: absolute;
left: 15px;
content: ' ';
height: 19px;
width: 2px;
background-color: red;
}
&:before {
transform: rotate(45deg);
}
&:after {
transform: rotate(-45deg);
}
2021-03-17 18:44:15 -07:00
`;
return (
<ErrorNotice>
<ErrorMessage>{props.message}</ErrorMessage>
2021-03-31 11:24:24 -07:00
<ErrorButton onClick={props.clearError}></ErrorButton>
2021-03-17 18:44:15 -07:00
</ErrorNotice>
);
}