|
| 1 | +import type { Interpolation, Theme } from "@emotion/react"; |
| 2 | +import { CodeExample } from "components/CodeExample/CodeExample"; |
| 3 | +import { Welcome } from "components/Welcome/Welcome"; |
| 4 | +import type { FC } from "react"; |
| 5 | +import { Link as RouterLink } from "react-router-dom"; |
| 6 | + |
| 7 | +export const CliInstallPageView: FC = () => { |
| 8 | + const origin = location.origin; |
| 9 | + |
| 10 | + return ( |
| 11 | + <div css={styles.container}> |
| 12 | + <Welcome>Install the Coder CLI</Welcome> |
| 13 | + |
| 14 | + <p css={styles.instructions}> |
| 15 | + Copy the command below and{" "} |
| 16 | + <strong css={{ display: "block" }}>paste it in your terminal.</strong> |
| 17 | + </p> |
| 18 | + |
| 19 | + <CodeExample |
| 20 | + css={{ maxWidth: "100%" }} |
| 21 | + data-chromatic="ignore" |
| 22 | + code={`curl -fsSL ${origin}/install.sh | sh`} |
| 23 | + secret={false} |
| 24 | + /> |
| 25 | + |
| 26 | + <div css={{ paddingTop: 16 }}> |
| 27 | + <RouterLink to="/workspaces" css={styles.backLink}> |
| 28 | + Go to workspaces |
| 29 | + </RouterLink> |
| 30 | + </div> |
| 31 | + <div css={styles.copyright}> |
| 32 | + {"\u00a9"} {new Date().getFullYear()} Coder Technologies, Inc. |
| 33 | + </div> |
| 34 | + </div> |
| 35 | + ); |
| 36 | +}; |
| 37 | + |
| 38 | +const styles = { |
| 39 | + container: { |
| 40 | + flex: 1, |
| 41 | + height: "-webkit-fill-available", |
| 42 | + display: "flex", |
| 43 | + flexDirection: "column", |
| 44 | + justifyContent: "center", |
| 45 | + alignItems: "center", |
| 46 | + width: 480, |
| 47 | + margin: "auto", |
| 48 | + }, |
| 49 | + |
| 50 | + instructions: (theme) => ({ |
| 51 | + fontSize: 16, |
| 52 | + color: theme.palette.text.secondary, |
| 53 | + paddingBottom: 8, |
| 54 | + textAlign: "center", |
| 55 | + lineHeight: 1.4, |
| 56 | + }), |
| 57 | + |
| 58 | + backLink: (theme) => ({ |
| 59 | + display: "block", |
| 60 | + textAlign: "center", |
| 61 | + color: theme.palette.text.primary, |
| 62 | + textDecoration: "underline", |
| 63 | + textUnderlineOffset: 3, |
| 64 | + textDecorationColor: "hsla(0deg, 0%, 100%, 0.7)", |
| 65 | + paddingTop: 16, |
| 66 | + paddingBottom: 16, |
| 67 | + |
| 68 | + "&:hover": { |
| 69 | + textDecoration: "none", |
| 70 | + }, |
| 71 | + }), |
| 72 | + |
| 73 | + copyright: (theme) => ({ |
| 74 | + fontSize: 12, |
| 75 | + color: theme.palette.text.secondary, |
| 76 | + marginTop: 24, |
| 77 | + }), |
| 78 | +} satisfies Record<string, Interpolation<Theme>>; |
0 commit comments