Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/components/landing/footer.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Col, Flex, Layout, Row, Space, Typography } from "antd";67import { COLORS } from "@cocalc/util/theme";89import A from "components/misc/A";10import Logo from "components/logo";11import { CSS } from "components/misc";12import { is_valid_email_address as isValidEmailAddress } from "@cocalc/util/misc";13import { MAX_WIDTH } from "lib/config";14import { useCustomize } from "lib/customize";1516import SocialMediaIconList from "./social-media-icon-list";17import { liveDemoUrl } from "components/landing/live-demo";1819const FOOTER_STYLE: CSS = {20borderTop: "1px solid lightgrey",21backgroundColor: "white",22};2324const FOOTER_COLUMNS_STYLE: CSS = {25minWidth: "200px",26flexGrow: 1,27};2829const FOOTER_COLUMN_STYLE = {30marginTop: "32px",31minWidth: "128px",32};3334const FOOTER_TABLE_STYLE: CSS = {35maxWidth: MAX_WIDTH,36marginBottom: "36px",37width: "100%",38};3940const LOGO_COLUMN_STYLE = {41paddingBottom: "24px",42marginTop: "32px",43};4445interface FooterLink {46text: string;47url: string;48hide?: boolean;49}5051interface FooterColumn {52header: string;53links: Array<FooterLink>;54}5556export default function Footer() {57const {58contactEmail,59onCoCalcCom,60organizationName,61organizationURL,62enabledPages,63termsOfServiceURL,64account,65} = useCustomize();6667const footerColumns: Array<FooterColumn> = [68{69header: "Product",70links: [71{72text: "Store",73url: "/store",74hide: !enabledPages?.store,75},76{77text: "Features",78url: "/features",79hide: !enabledPages?.features,80},81{82text: "Licenses",83url: "/licenses",84hide: !enabledPages?.licenses,85},86{87text: "Pricing",88url: "/pricing",89hide: !enabledPages?.pricing,90},91{92text: "On Premises",93url: "/pricing/onprem",94hide: !enabledPages?.onPrem,95},96{97text: "System Activity",98url: "/info/status",99hide: !enabledPages?.systemActivity,100},101{102text: "Status",103url: "https://status.cocalc.com/",104hide: !enabledPages?.status,105},106],107},108{109header: "Resources",110links: [111{112text: "Documentation",113url: "/info/doc",114hide: !enabledPages?.info,115},116{117text: "Compute Servers",118url: "https://doc.cocalc.com/compute_server.html",119hide: !enabledPages?.compute,120},121{122text: "Public Share",123url: "/share/public_paths/page/1",124hide: !enabledPages?.share,125},126{127text: "Software",128url: "/software",129hide: !enabledPages?.software,130},131{132text: "Support",133url: "/support",134hide: !enabledPages?.support,135},136{137text: "Get a Live Demo",138url: liveDemoUrl("footer"),139hide: !account || !enabledPages?.support,140},141],142},143{144header: "Company",145links: [146{147text: "About",148url: "/about",149hide: !enabledPages?.about.index,150},151{152text: "Contact",153url: contactEmail || "",154hide: !enabledPages?.contact,155},156{157text: "Events",158url: "/about/events",159hide: !enabledPages?.about.events,160},161{162text: "Team",163url: "/about/team",164hide: !enabledPages?.about.team,165},166{167text: "Imprint",168url: "/policies/imprint",169hide: !enabledPages?.policies.imprint,170},171{172text: "News",173url: "/news",174hide: !enabledPages?.news,175},176{177text: "Policies",178url: "/policies",179hide: !enabledPages?.policies.index,180},181{182text: "Terms of Service",183url: termsOfServiceURL || "",184hide: !enabledPages?.termsOfService,185},186{187text: organizationName || "Company",188url: organizationURL || "",189hide: !enabledPages?.organization,190},191],192},193];194195function renderFooterColumns() {196return footerColumns.map((column) => (197<Space198key={`footer-column-${column.header}`}199direction="vertical"200size="small"201style={FOOTER_COLUMN_STYLE}202>203<Typography.Title level={5}>{column.header}</Typography.Title>204{column.links205.filter((footerLink) => !footerLink.hide)206.map((footerLink) => (207<A208key={footerLink.url}209href={210isValidEmailAddress(footerLink.url)211? `mailto:${footerLink.url}`212: footerLink.url213}214style={{ color: COLORS.GRAY_D }}215>216{footerLink.text}217</A>218))}219</Space>220));221}222223return (224<Layout.Footer style={FOOTER_STYLE}>225<Flex justify="center">226<Row justify="space-between" style={FOOTER_TABLE_STYLE}>227<Col xs={24} md={8}>228<Flex229justify="space-between"230align="center"231wrap="wrap"232style={LOGO_COLUMN_STYLE}233>234<Logo type="rectangular" width={150} />235{onCoCalcCom && (236<SocialMediaIconList237links={{238facebook: "https://www.facebook.com/CoCalcOnline",239github: "https://github.com/sagemathinc/cocalc",240linkedin: "https://www.linkedin.com/company/sagemath-inc./",241twitter: "https://twitter.com/cocalc_com",242youtube: "https://www.youtube.com/c/SagemathCloud",243}}244iconFontSize={20}245/>246)}247</Flex>248</Col>249<Col xs={24} md={16}>250<Flex251justify="space-between"252style={FOOTER_COLUMNS_STYLE}253wrap="wrap"254>255{renderFooterColumns()}256</Flex>257</Col>258</Row>259</Flex>260</Layout.Footer>261);262}263264265