2019-09-17 15:55:31 +02:00
|
|
|
import styled, { createGlobalStyle } from 'styled-components';
|
2020-04-26 18:13:20 +02:00
|
|
|
import { themePropTypes } from 'strapi-helper-plugin';
|
2016-09-30 18:25:04 +02:00
|
|
|
|
2019-09-17 15:55:31 +02:00
|
|
|
const GlobalNotification = createGlobalStyle`
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationIcon {
|
|
|
|
position: relative;
|
|
|
|
display: block;
|
|
|
|
width: 60px;
|
|
|
|
height: 60px;
|
|
|
|
> div {
|
|
|
|
position: absolute;
|
|
|
|
width: 20px;
|
|
|
|
height: 20px;
|
|
|
|
top: 19px;
|
|
|
|
left:20px;
|
|
|
|
border-radius: 10px;
|
|
|
|
border: 1px solid ${props => props.theme.main.colors.green};
|
|
|
|
display: flex;
|
|
|
|
svg {
|
|
|
|
margin: auto;
|
|
|
|
color: ${props => props.theme.main.colors.green};
|
|
|
|
width: 10px;
|
2020-01-23 09:43:57 +01:00
|
|
|
height: 10px;
|
2020-01-23 09:36:25 +01:00
|
|
|
}
|
2019-11-24 23:44:58 +01:00
|
|
|
}
|
2017-09-09 14:43:11 +02:00
|
|
|
}
|
2016-09-30 18:25:04 +02:00
|
|
|
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationContent {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
width: 220px;
|
|
|
|
margin: 0;
|
|
|
|
padding-right: 10px;
|
|
|
|
border-right: 1px solid rgba(255, 255, 255, 0.3);
|
|
|
|
}
|
2016-09-30 18:25:04 +02:00
|
|
|
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationTitle {
|
|
|
|
margin-bottom: 0;
|
|
|
|
font-size: 1.4rem;
|
|
|
|
font-weight: 400;
|
|
|
|
line-height: 1.8rem;
|
2016-09-30 18:25:04 +02:00
|
|
|
}
|
|
|
|
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationClose {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
width: 20px;
|
2020-04-26 19:20:56 +02:00
|
|
|
margin-right: 15px;
|
|
|
|
cursor: pointer;
|
|
|
|
opacity: 0.6;
|
2020-01-23 09:36:25 +01:00
|
|
|
font-size: 1.4rem;
|
|
|
|
color: #BBC2BF;
|
|
|
|
transition: opacity 0.1s ease;
|
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
svg {
|
|
|
|
margin: auto;
|
|
|
|
font-size: 1.3rem;
|
|
|
|
font-weight: 100!important;
|
|
|
|
}
|
2016-09-30 18:25:04 +02:00
|
|
|
}
|
2017-09-09 14:43:11 +02:00
|
|
|
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationSuccess{
|
2020-04-24 12:07:07 +02:00
|
|
|
background: linear-gradient(
|
2020-04-26 18:13:20 +02:00
|
|
|
100deg,
|
2020-04-24 12:07:07 +02:00
|
|
|
#FFFFFF 50%,
|
2020-04-26 19:20:56 +02:00
|
|
|
rgba(39, 183, 15, .05)),
|
|
|
|
${props => props.theme.main.colors.white};
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationIcon {
|
|
|
|
div {
|
|
|
|
border-color: ${props => props.theme.main.colors.green};
|
|
|
|
}
|
|
|
|
svg {
|
|
|
|
color: ${props => props.theme.main.colors.green};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-09-19 13:40:26 +02:00
|
|
|
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationWarning {
|
2020-04-24 12:07:07 +02:00
|
|
|
background: linear-gradient(
|
2020-04-26 18:13:20 +02:00
|
|
|
100deg,
|
2020-04-24 12:07:07 +02:00
|
|
|
#FFFFFF 50%,
|
2020-04-26 19:20:56 +02:00
|
|
|
rgba(250, 156, 0, .05)),
|
|
|
|
${props => props.theme.main.colors.white};
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationIcon {
|
|
|
|
div {
|
|
|
|
border-color: ${props => props.theme.main.colors.orange};
|
|
|
|
}
|
|
|
|
svg {
|
|
|
|
color: ${props => props.theme.main.colors.orange};
|
|
|
|
}
|
|
|
|
}
|
2017-09-09 14:43:11 +02:00
|
|
|
}
|
2017-09-19 13:40:26 +02:00
|
|
|
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationError {
|
2020-04-26 19:20:56 +02:00
|
|
|
background: linear-gradient(100deg , #FFFFFF 50%, rgba(255, 93, 0, .05)), $white;
|
|
|
|
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationIcon {
|
|
|
|
div {
|
|
|
|
border-color: ${props => props.theme.main.colors.red};
|
|
|
|
}
|
|
|
|
svg {
|
|
|
|
color: ${props => props.theme.main.colors.red};
|
|
|
|
}
|
|
|
|
}
|
2017-09-09 14:43:11 +02:00
|
|
|
}
|
|
|
|
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationInfo {
|
2020-04-26 18:13:20 +02:00
|
|
|
background: linear-gradient(
|
|
|
|
100deg,
|
2020-04-24 12:07:07 +02:00
|
|
|
#FFFFFF 50%,
|
2020-04-26 19:20:56 +02:00
|
|
|
rgba(28, 93, 231, .05)),
|
|
|
|
${props => props.theme.main.colors.white};
|
2020-01-23 09:36:25 +01:00
|
|
|
.notificationIcon {
|
|
|
|
div {
|
|
|
|
border-color: ${props => props.theme.main.colors.blue};
|
|
|
|
}
|
|
|
|
svg {
|
|
|
|
color: ${props => props.theme.main.colors.blue};
|
|
|
|
}
|
|
|
|
}
|
2017-09-09 14:43:11 +02:00
|
|
|
}
|
2019-09-17 15:55:31 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
const Li = styled.li`
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
2020-02-28 11:51:57 +01:00
|
|
|
align-items: center;
|
2019-09-17 15:55:31 +02:00
|
|
|
width: 300px;
|
|
|
|
min-height: 60px;
|
|
|
|
margin-bottom: 14px;
|
|
|
|
background: ${props => props.theme.main.colors.white};
|
|
|
|
border-radius: 2px;
|
|
|
|
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.15);
|
|
|
|
color: #333740;
|
|
|
|
transition: all 0.15s ease;
|
|
|
|
overflow: hidden;
|
|
|
|
z-index: 10;
|
2020-02-28 11:51:57 +01:00
|
|
|
padding: 1rem;
|
2020-01-23 09:36:25 +01:00
|
|
|
border-left: 2px solid ${props => props.theme.main.colors.green};
|
2020-01-23 09:43:57 +01:00
|
|
|
&.notificationError {
|
|
|
|
border-color: ${props => props.theme.main.colors.red};
|
|
|
|
}
|
|
|
|
&.notificationWarning {
|
|
|
|
border-color: ${props => props.theme.main.colors.orange};
|
|
|
|
}
|
|
|
|
&.notificationInfo {
|
|
|
|
border-color: ${props => props.theme.main.colors.blue};
|
|
|
|
}
|
2019-09-17 15:55:31 +02:00
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.2);
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
Li.defaultProps = {
|
|
|
|
theme: {
|
|
|
|
main: {
|
|
|
|
colors: {
|
|
|
|
leftMenu: {},
|
|
|
|
},
|
|
|
|
sizes: {
|
|
|
|
header: {},
|
|
|
|
leftMenu: {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
Li.propTypes = {
|
2020-04-26 18:13:20 +02:00
|
|
|
...themePropTypes,
|
2019-09-17 15:55:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default Li;
|
|
|
|
|
|
|
|
export { GlobalNotification };
|