summaryrefslogtreecommitdiff
path: root/server/web/src/design/components/Alert.design.tsx
blob: ff634bf34a6fdc928002df0372b798e985f4e1ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { IAlertButton } from '../../interfaces/design/AlertDesign.interface';
import styled from 'styled-components';

const calcBgColor = (color: string) => {
    switch (color) {
        case 'SUCCESS':
            return 'rgb(24, 79, 59)';
        case 'DANGER':
            return 'rgb(175, 45, 45)';
        case 'WARNING':
            return 'rgb(175, 121, 21)';
        case 'INFO':
            return 'rgb(23, 52, 102)';
    }
};

export const AlertButton = styled('div') <IAlertButton>`
    background-color: ${(props) => calcBgColor(props.bgColor)};
    border: solid thin rgb(255, 255, 255);
    grid-template-columns: 1fr auto;
    color: rgb(255, 255, 255);
    align-items: center;
    min-height: 2.5rem;
    text-align: center;
    font-size: 0.8rem;
    width: 17.5rem;
    display: grid;

    @media (min-width: 768px) {
        width: 22.5rem;
    }
`;

export const AlertButtonCross = styled('span')`
    border-left: solid thin rgb(255, 255, 255);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    padding: 0.5rem 1rem;
    align-items: center;
    font-size: 1.25rem;
    user-select: none;
    cursor: pointer;
    display: grid;
    height: 100%;
`;