-
-
Notifications
You must be signed in to change notification settings - Fork 766
/
Copy pathnext-steps-content-section.tsx
147 lines (131 loc) · 3.06 KB
/
next-steps-content-section.tsx
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import React, { ReactElement, ReactNode } from "react";
import styled, { css } from "styled-components";
import { IconContainer, LinkButton, LinkTextButton } from "@/components/misc";
import { Icon } from "@/components/sprites";
import { MAX_CONTENT_WIDTH } from "@/style";
// Icons
import ArrowRightIconSvg from "@/images/icons/arrow-right.svg";
export interface NextStepsContentSectionProps {
readonly title: string;
readonly text: ReactNode;
readonly primaryLink: string;
readonly primaryLinkText: string;
readonly secondaryLink?: string;
readonly secondaryLinkText?: string;
readonly dense?: boolean;
}
export function NextStepsContentSection({
title,
text,
primaryLink,
primaryLinkText,
secondaryLink,
secondaryLinkText,
dense,
}: NextStepsContentSectionProps): ReactElement {
return (
<ContentSection>
<VisibleArea dense={dense}>
<Content>
<Title>{title}</Title>
<Text>{text}</Text>
</Content>
<Actions>
<LinkButton to={primaryLink}>{primaryLinkText}</LinkButton>
{secondaryLink && secondaryLinkText && (
<LinkTextButton to={secondaryLink}>
{secondaryLinkText}
<IconContainer $size={16}>
<Icon {...ArrowRightIconSvg} />
</IconContainer>
</LinkTextButton>
)}
</Actions>
{!dense && <RadialGradient />}
</VisibleArea>
</ContentSection>
);
}
const ContentSection = styled.section.attrs({
className: "animate",
})`
display: flex;
flex: 0 0 auto;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 100%;
overflow: visible;
padding-right: 16px;
padding-left: 16px;
&.play .play-me {
animation-play-state: running;
}
@media only screen and (min-width: 1246px) {
padding-right: 0;
padding-left: 0;
}
`;
const VisibleArea = styled.div<{
readonly dense?: boolean;
}>`
position: relative;
display: flex;
flex: 1 1 auto;
flex-direction: column;
justify-content: center;
width: 100%;
height: 100%;
max-width: ${MAX_CONTENT_WIDTH}px;
gap: 52px;
overflow: visible;
perspective: 1px;
${({ dense }) =>
dense
? ""
: css`
padding-top: 120px;
padding-bottom: 120px;
`}
`;
const Content = styled.div`
display: flex;
flex: 0 0 auto;
flex-direction: column;
align-items: center;
gap: 24px;
overflow: visible;
@media only screen and (min-width: 992px) {
gap: 32px;
}
`;
const Title = styled.h2`
text-align: center;
`;
const Text = styled.p.attrs({
className: "text-2",
})`
width: 80vw;
text-align: center;
@media only screen and (min-width: 992px) {
width: 800px;
}
`;
const Actions = styled.div`
display: flex;
flex: 1 1 auto;
flex-direction: row;
align-items: center;
justify-content: center;
gap: 24px;
`;
const RadialGradient = styled.div`
position: absolute;
z-index: -1;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-image: radial-gradient(ellipse, #bcddf624 0%, #0a072100 60%);
`;