PromucFlow_constructor/app/client/src/components/designSystems/appsmith/NotificationIcon.tsx

71 lines
1.7 KiB
TypeScript
Raw Normal View History

2020-05-28 18:10:26 +00:00
import styled from "styled-components";
import { hexToRgb } from "utils/AppsmithUtils";
export default styled.span<{
animate?: boolean;
width?: number;
height?: number;
color?: string;
}>`
&&& {
display: block;
2020-12-24 04:32:25 +00:00
width: ${(props) => props.width || 8}px;
height: ${(props) => props.height || 8}px;
2020-05-28 18:10:26 +00:00
border-radius: 50%;
2020-12-24 04:32:25 +00:00
background: ${(props) => props.color || props.theme.colors.notification};
2020-05-28 18:10:26 +00:00
cursor: pointer;
box-shadow: 0 0 0
rgba(
2020-12-24 04:32:25 +00:00
${(props) => {
2020-05-28 18:10:26 +00:00
const rgb = hexToRgb(props.color || props.theme.colors.notification);
return `${rgb.r}, ${rgb.g}, ${rgb.b}`;
}},
0.4
);
2020-12-24 04:32:25 +00:00
animation: ${(props) => (!!props.animate ? "pulse 2s infinite" : "")};
2020-05-28 18:10:26 +00:00
&:hover {
animation: none;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0
rgba(
2020-12-24 04:32:25 +00:00
${(props) => {
2020-05-28 18:10:26 +00:00
const rgb = hexToRgb(
props.color || props.theme.colors.notification,
);
return `${rgb.r}, ${rgb.g}, ${rgb.b}`;
}},
0.4
);
}
70% {
box-shadow: 0 0 0 15px
rgba(
2020-12-24 04:32:25 +00:00
${(props) => {
2020-05-28 18:10:26 +00:00
const rgb = hexToRgb(
props.color || props.theme.colors.notification,
);
return `${rgb.r}, ${rgb.g}, ${rgb.b}`;
}},
0
);
}
100% {
box-shadow: 0 0 0 0
rgba(
2020-12-24 04:32:25 +00:00
${(props) => {
2020-05-28 18:10:26 +00:00
const rgb = hexToRgb(
props.color || props.theme.colors.notification,
);
return `${rgb.r}, ${rgb.g}, ${rgb.b}`;
}},
0
);
}
}
}
`;