CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/lib/styles/layouts.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Col, Row } from "antd";
7
8
import { Icon } from "@cocalc/frontend/components/icon";
9
import { COLORS } from "@cocalc/util/theme";
10
import { CSS, Paragraph, Title } from "components/misc";
11
import A from "components/misc/A";
12
13
const gridProps = { sm: 24, md: 12 } as const;
14
15
export const OVERVIEW_STYLE: React.CSSProperties = {
16
textAlign: "center",
17
width: "75%",
18
margin: "0px auto 0px auto",
19
} as const;
20
21
export const OVERVIEW_LARGE_ICON: React.CSSProperties = {
22
fontSize: "100px",
23
color: COLORS.COCALC_BLUE,
24
borderRadius: "50%",
25
backgroundColor: COLORS.COCALC_ORANGE,
26
border: `15px solid ${COLORS.COCALC_BLUE}`,
27
padding: "20px 20px 15px 15px",
28
display: "inline-block",
29
margin: "30px 0px 40px 0px",
30
boxShadow: "0px 2px 10px 2px",
31
} as const;
32
33
// variation of the above, since some icons need more margin
34
export const OVERVIEW_LARGE_ICON_MARGIN: React.CSSProperties = {
35
...OVERVIEW_LARGE_ICON,
36
padding: "23px 20px 20px 20px",
37
fontSize: "80px",
38
} as const;
39
40
const ICON_SIZE = "50px";
41
const ICON_STYLE: CSS = { fontSize: ICON_SIZE, fontWeight: "bold" } as const;
42
43
export function Product({
44
icon,
45
icon2,
46
title,
47
href,
48
children,
49
external,
50
}: {
51
icon;
52
icon2?;
53
title;
54
href;
55
children;
56
external?;
57
}) {
58
function renderIcon2() {
59
if (!icon2) return null;
60
return (
61
<>
62
<span
63
style={{
64
fontSize: "30px",
65
paddingLeft: "10px",
66
paddingRight: "10px",
67
}}
68
>
69
/
70
</span>
71
<Icon style={ICON_STYLE} name={icon2} />
72
</>
73
);
74
}
75
76
return (
77
<Col {...gridProps}>
78
{/* display: flex to avoid line breaks if there are 2 icons */}
79
<A
80
href={href}
81
external={external}
82
style={{
83
display: "flex",
84
justifyContent: "center",
85
alignItems: "center",
86
marginBottom: "10px",
87
}}
88
>
89
<Icon style={ICON_STYLE} name={icon} />
90
{renderIcon2()}
91
</A>
92
<Title
93
level={2}
94
style={{ fontSize: "25px", marginBottom: "15px", marginTop: "15px" }}
95
>
96
<A href={href} external={external}>
97
{title}
98
</A>
99
</Title>
100
<Paragraph>{children}</Paragraph>
101
</Col>
102
);
103
}
104
105
export function OverviewRow({ children }) {
106
return (
107
<Row gutter={[25, 50]} style={{ marginTop: "30px", marginBottom: "60px" }}>
108
{children}
109
</Row>
110
);
111
}
112
113