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/pages/testimonials/index.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2023 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Button, Layout, Space } from "antd";
7
import { GetServerSidePropsContext } from "next";
8
import { join } from "path";
9
10
import { Icon } from "@cocalc/frontend/components/icon";
11
import Footer from "components/landing/footer";
12
import Head from "components/landing/head";
13
import Header from "components/landing/header";
14
import { Paragraph, Title } from "components/misc";
15
import { TESTIMONIALS, TestimonialComponent } from "components/testimonials";
16
import basePath from "lib/base-path";
17
import { MAX_WIDTH } from "lib/config";
18
import { Customize, CustomizeType } from "lib/customize";
19
import withCustomize from "lib/with-customize";
20
21
interface Props {
22
customize: CustomizeType;
23
}
24
25
export default function AllNews(props: Props) {
26
const { customize } = props;
27
const { siteName } = customize;
28
29
30
function content() {
31
return (
32
<>
33
<Title level={1} style={{ textAlign: "center", margin: "40px 0" }}>
34
<Icon name="comments" /> {siteName} Testimonials
35
</Title>
36
<Space direction="vertical" size="large" style={{ width: "100%" }}>
37
{TESTIMONIALS.map((testimonial, idx) => (
38
<TestimonialComponent key={idx} testimonial={testimonial} />
39
))}
40
</Space>
41
<Paragraph style={{ textAlign: "center", margin: "40px 0" }}>
42
<Button
43
size="large"
44
onClick={() => (window.location.href = join(basePath, "/"))}
45
title={`Open the ${siteName} homepage.`}
46
type="primary"
47
>
48
Home
49
</Button>
50
</Paragraph>
51
</>
52
);
53
}
54
55
return (
56
<Customize value={customize}>
57
<Head title={`${siteName} Testimonials`} />
58
<Layout>
59
<Header />
60
<Layout.Content style={{ backgroundColor: "white" }}>
61
<div
62
style={{
63
minHeight: "75vh",
64
maxWidth: MAX_WIDTH,
65
padding: "30px 15px",
66
margin: "0 auto",
67
}}
68
>
69
{content()}
70
</div>
71
<Footer />
72
</Layout.Content>
73
</Layout>
74
</Customize>
75
);
76
}
77
78
export async function getServerSideProps(context: GetServerSidePropsContext) {
79
return await withCustomize({ context });
80
}
81
82