mirror of
https://github.com/coder/coder.git
synced 2026-11-12 20:50:29 +08:00
For black-triangle and alpha builds, we won't be able to create projects in the UI, because they require collecting and tar'ing a set of assets associated with the project - so the CLI is going to be our entry point for creating projects. This shifts the UI to remove the 'Create Project' button, and adds a prompt to copy a command to run. __Before:__ <img width="1134" alt="image" src="https://user-images.githubusercontent.com/88213859/153534269-58dc95bd-0417-4bed-8e62-e2b6f479da61.png"> __After:__ 
38 lines
867 B
TypeScript
38 lines
867 B
TypeScript
import { makeStyles } from "@material-ui/core/styles"
|
|
import React from "react"
|
|
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
|
|
|
|
export interface CodeBlockProps {
|
|
lines: string[]
|
|
}
|
|
|
|
export const CodeBlock: React.FC<CodeBlockProps> = ({ lines }) => {
|
|
const styles = useStyles()
|
|
|
|
return (
|
|
<div className={styles.root}>
|
|
{lines.map((line, idx) => (
|
|
<div className={styles.line} key={idx}>
|
|
{line}
|
|
</div>
|
|
))}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
const useStyles = makeStyles((theme) => ({
|
|
root: {
|
|
minHeight: 156,
|
|
background: theme.palette.background.default,
|
|
color: theme.palette.codeBlock.contrastText,
|
|
fontFamily: MONOSPACE_FONT_FAMILY,
|
|
fontSize: 13,
|
|
wordBreak: "break-all",
|
|
padding: theme.spacing(2),
|
|
borderRadius: theme.shape.borderRadius,
|
|
},
|
|
line: {
|
|
whiteSpace: "pre-wrap",
|
|
},
|
|
}))
|