- {lines.map((line, idx) => (
-
- {line}
+ <>
+
+ {lines.map((line, idx) => (
+
+ {line}
+
+ ))}
+
+ {ctas && ctas.length && (
+
+ {ctas.map((cta, i) => {
+ return {cta}
+ })}
- ))}
-
+ )}
+ >
)
}
const useStyles = makeStyles((theme) => ({
root: {
minHeight: 156,
+ maxHeight: 240,
+ overflowY: "scroll",
background: theme.palette.background.default,
color: theme.palette.text.primary,
fontFamily: MONOSPACE_FONT_FAMILY,
@@ -36,4 +48,8 @@ const useStyles = makeStyles((theme) => ({
line: {
whiteSpace: "pre-wrap",
},
+ ctaBar: {
+ display: "flex",
+ justifyContent: "space-between",
+ },
}))
diff --git a/site/src/components/CopyButton/CopyButton.tsx b/site/src/components/CopyButton/CopyButton.tsx
index 0ddd865f27..80b53d1a7e 100644
--- a/site/src/components/CopyButton/CopyButton.tsx
+++ b/site/src/components/CopyButton/CopyButton.tsx
@@ -1,19 +1,27 @@
-import Button from "@material-ui/core/Button"
+import IconButton from "@material-ui/core/Button"
import { makeStyles } from "@material-ui/core/styles"
import Tooltip from "@material-ui/core/Tooltip"
import Check from "@material-ui/icons/Check"
import React, { useState } from "react"
+import { combineClasses } from "../../util/combineClasses"
import { FileCopyIcon } from "../Icons/FileCopyIcon"
interface CopyButtonProps {
text: string
- className?: string
+ ctaCopy?: string
+ wrapperClassName?: string
+ buttonClassName?: string
}
/**
* Copy button used inside the CodeBlock component internally
*/
-export const CopyButton: React.FC
= ({ className = "", text }) => {
+export const CopyButton: React.FC = ({
+ text,
+ ctaCopy,
+ wrapperClassName = "",
+ buttonClassName = "",
+}) => {
const styles = useStyles()
const [isCopied, setIsCopied] = useState(false)
@@ -36,10 +44,15 @@ export const CopyButton: React.FC = ({ className = "", text })
return (
-
-
+ )
+}
+
+/**
+ * createCtas generates an array of buttons to be used with our error boundary UI
+ */
+export const createCtas = (codeBlock: string[]): React.ReactElement[] => {
+ // REMARK: we don't have to worry about key order changing
+ // eslint-disable-next-line react/jsx-key
+ return [
,
]
+}
+
+const useStyles = makeStyles((theme) => ({
+ buttonWrapper: {
+ marginTop: theme.spacing(1),
+ marginLeft: 0,
+ flex: theme.spacing(1),
+ textTransform: "uppercase",
+ fontSize: theme.typography.fontSize,
+ },
+
+ copyButton: {
+ width: "100%",
+ marginRight: theme.spacing(1),
+ backgroundColor: theme.palette.primary.main,
+ textTransform: "uppercase",
+ fontSize: theme.typography.fontSize,
+ },
+}))
diff --git a/site/src/components/Section/Section.tsx b/site/src/components/Section/Section.tsx
index 97dc042be9..22bf0dd101 100644
--- a/site/src/components/Section/Section.tsx
+++ b/site/src/components/Section/Section.tsx
@@ -2,6 +2,7 @@ import { makeStyles } from "@material-ui/core/styles"
import { fade } from "@material-ui/core/styles/colorManipulator"
import Typography from "@material-ui/core/Typography"
import React from "react"
+import { combineClasses } from "../../util/combineClasses"
import { SectionAction } from "../SectionAction/SectionAction"
type SectionLayout = "fixed" | "fluid"
@@ -12,15 +13,24 @@ export interface SectionProps {
toolbar?: React.ReactNode
alert?: React.ReactNode
layout?: SectionLayout
+ className?: string
children?: React.ReactNode
}
type SectionFC = React.FC
& { Action: typeof SectionAction }
-export const Section: SectionFC = ({ title, description, toolbar, alert, children, layout = "fixed" }) => {
+export const Section: SectionFC = ({
+ title,
+ description,
+ toolbar,
+ alert,
+ className = "",
+ children,
+ layout = "fixed",
+}) => {
const styles = useStyles({ layout })
return (
-
+
{(title || description) && (
diff --git a/site/yarn.lock b/site/yarn.lock
index cd898202a6..0ab541c8bc 100644
--- a/site/yarn.lock
+++ b/site/yarn.lock
@@ -11991,6 +11991,11 @@ source-map-url@^0.4.0:
resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56"
integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==
+source-map@0.5.6:
+ version "0.5.6"
+ resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
+ integrity sha1-dc449SvwczxafwwRjYEzSiu19BI=
+
source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7:
version "0.5.7"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
@@ -12006,6 +12011,13 @@ source-map@^0.7.3, source-map@~0.7.2:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==
+sourcemapped-stacktrace@1.1.11:
+ version "1.1.11"
+ resolved "https://registry.yarnpkg.com/sourcemapped-stacktrace/-/sourcemapped-stacktrace-1.1.11.tgz#e2dede7fc148599c52a4f883276e527f8452657d"
+ integrity sha512-O0pcWjJqzQFVsisPlPXuNawJHHg9N9UgpJ/aDmvi9+vnS3x1C0NhwkVFzzZ1VN0Xo+bekyweoqYvBw5ZBKiNnQ==
+ dependencies:
+ source-map "0.5.6"
+
space-separated-tokens@^1.0.0:
version "1.1.5"
resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899"