aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/@next/components/slider/slider.tsx
blob: 6292a8c9e4cb79794977ea2edc429188ea5281d4 (plain) (blame)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import * as React from 'react';
import styled from 'styled-components';

import { colors } from 'ts/style/colors';

import { Icon } from 'ts/@next/components/icon';
import { Paragraph, Heading } from 'ts/@next/components/text';

interface SliderProps {
}

interface SlideProps {
    icon: string;
    heading: string;
    text: string;
    href?: string;
}

export const Slide: React.StatelessComponent<SlideProps> = (props: SlideProps) => {
    const { heading, text, href, icon } = props;

    return (
        <StyledSlide>
            <SlideHead>
                <Icon name={icon} size="large" margin="auto" />
            </SlideHead>
            <SlideContent>
                <Heading asElement="h4" size="small" marginBottom="15px">{heading}</Heading>
                <Paragraph isMuted={true}>{text}</Paragraph>
            </SlideContent>
        </StyledSlide>
    );
};

export const Slider: React.StatelessComponent<SliderProps> = props => {
    return (
        <StyledSlider>
            <SliderInner>
                {props.children}
            </SliderInner>
        </StyledSlider>
    );
};

const StyledSlider = styled.div`
    overflow: hidden;
    width: 100%;
    height: 520px;
`;

const SliderInner = styled.div`
    position: absolute;
    display: flex;
    width: 100%;
`;

const StyledSlide = styled.div`
    background-color: ${colors.backgroundDark};
    width: 560px;
    height: 520px;
    flex: 0 0 auto;

    & + & {
        margin-left: 30px;
    }
`;

const SlideHead = styled.div`
    background-color: ${colors.brandDark};
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
`;

const SlideContent = styled.div`
    padding: 30px;
`;