Skip to content

refactor: Add <CodeBlock /> component #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add CodeBlock, use theme colors
  • Loading branch information
bryphe-coder committed Feb 4, 2022
commit eb9aee36301fe028df04de9f5edc68c8975df2b8
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { makeStyles } from "@material-ui/core/styles"
import React from "react"

interface Props {
output: string[]
lines: string[]
}

export const TerminalOutput: React.FC<Props> = ({ className, output }) => {
export const CodeBlock: React.FC<Props> = ({ lines }) => {
const styles = useStyles()

return (
<div className={styles.root}>
{output.map((line, idx) => (
{lines.map((line, idx) => (
<div className={styles.line} key={idx}>
{line}
</div>
Expand All @@ -25,7 +25,7 @@ const useStyles = makeStyles((theme) => ({
root: {
minHeight: 156,
background: theme.palette.background.default,
//color: theme.palette.codeBlock.contrastText,
color: theme.palette.codeBlock.contrastText,
fontFamily: MONOSPACE_FONT_FAMILY,
fontSize: 13,
wordBreak: "break-all",
Expand Down