blob: 88ef6acdc7aa196af6ca03df879b88d8003acf96 (
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
import * as React from 'react';
import styled from 'styled-components';
import {Link} from 'ts/@next/components/button';
import { Icon } from 'ts/@next/components/icon';
interface Action {
label: string;
url: string;
}
interface Props {
isInline?: boolean;
isInlineIcon?: boolean;
isCentered?: boolean;
isWithMargin?: boolean;
iconSize?: 'medium' | 'large' | number;
title: string;
description: React.Node;
actions?: Action[];
}
export const Definition = (props: Props) => (
<Wrap isWithMargin={props.isWithMargin} isInline={props.isInline} isInlineIcon={props.isInlineIcon}>
<Icon
name="ready-to-build"
size={props.iconSize || 'medium'}
margin={[0, 0, 'default', 0]}
/>
<TextWrap>
<Title>
{props.title}
</Title>
<Paragraph>
{props.description}
</Paragraph>
{props.actions &&
<LinkWrap>
{props.actions.map((item, index) => (
<Link
href={item.url}
isWithArrow={true}
isTransparent={true}
isNoBorder={true}
isAccentColor={true}
>
{item.label}
</Link>
))}
</LinkWrap>
}
</TextWrap>
</Wrap>
);
const Wrap = styled.div`
max-width: ${props => props.isInline && '354px'};
& + & {
margin-top: ${props => (props.isWithMargin && !props.isInlineIcon) ? '60px' : '120px'};
}
@media (min-width: 768px) {
width: ${props => props.isInline ? 'calc(33.3333% - 30px)' : '100%'};
display: ${props => props.isInlineIcon && 'flex'};
justify-content: ${props => props.isInlineIcon && 'space-between'};
align-items: ${props => props.isInlineIcon && 'center'};
text-align: ${props => props.isInlineIcon && 'left'};
}
@media (max-width: 768px) {
margin: 0 auto;
& + & {
margin-top: ${props => props.isInline && '60px'};
}
}
`;
const TextWrap = styled.div`
width: 100%;
max-width: 560px;
`;
const Title = styled.h2`
font-size: 20px;
line-height: 1.3;
margin-bottom: 15px;
`;
const Paragraph = styled.p`
font-size: 17px;
opacity: 0.75;
`;
const LinkWrap = styled.div`
display: inline-flex;
margin-top: 60px;
a + a {
margin-left: 60px;
}
`;
|