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/pages/vouchers/index.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Layout } from "antd";6import Header from "components/landing/header";7import Head from "components/landing/head";8import { Icon } from "@cocalc/frontend/components/icon";9import A from "components/misc/A";10import SiteName from "components/share/site-name";11import {12OverviewRow,13OVERVIEW_LARGE_ICON,14OVERVIEW_STYLE,15Product,16} from "lib/styles/layouts";17import withCustomize from "lib/with-customize";18import { Customize } from "lib/customize";19import useProfile from "lib/hooks/profile";2021export default function Overview({ customize }) {22const profile = useProfile();23return (24<Customize value={customize}>25<Head title="Voucher Center" />26<Layout>27<Header />28<Layout.Content style={{ background: "white" }}>29<div style={OVERVIEW_STYLE}>30<Icon style={OVERVIEW_LARGE_ICON} name="gift" />31<h2 style={{ marginBottom: "30px" }}>32Welcome to the <SiteName /> Voucher Center!33</h2>34<div style={{ fontSize: "12pt" }}>35<div style={{ maxWidth: "700px", margin: "auto" }}>36<A href="https://doc.cocalc.com/vouchers.html">Vouchers</A> are37like a digital gift card, which can be used to purchase anything38on <SiteName />.39</div>40</div>41<OverviewRow>42<Product43href={"/store/vouchers"}44icon="shopping-cart"45title="Buy Vouchers"46>47Create voucher codes that you can share, resell, or use later.48</Product>49<Product icon="gift2" title="Redeem a Voucher" href="/redeem">50Redeem a voucher code to add{" "}51<A href="/settings/purchases">money</A> or{" "}52<A href="/settings/licenses">licenses</A> to your account.53</Product>54<Product55icon="table"56title="Vouchers You Redeemed"57href="/vouchers/redeemed"58>59See a list of all vouchers you have redeemed and links to the60corresponding <A href="/settings/licenses">licenses</A>.61</Product>62<Product63href={"/vouchers/created"}64icon="csv"65title="Your Vouchers"66>67Browse all vouchers you have created and see their status.68</Product>69</OverviewRow>70{profile?.is_admin && (71<div72style={{73display: "flex",74justifyContent: "center",75marginBottom: "30px",76}}77>78<Product79href={"/vouchers/admin"}80icon="users"81title="Admin -- Voucher Payment Status"82>83See the status of all vouchers that users have created.{" "}84<b>This page is only available to site admins.</b>85</Product>86</div>87)}88</div>89</Layout.Content>90</Layout>91</Customize>92);93}9495export async function getServerSideProps(context) {96return await withCustomize({ context });97}9899100