X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/fc3d9ac09fbb1cdc4fb4b00f2f704795ad365110..59100a72caedbc8f3c9872de1153bf3d4129122a:/src/components/code-snippet/code-snippet.tsx diff --git a/src/components/code-snippet/code-snippet.tsx b/src/components/code-snippet/code-snippet.tsx index dda607cd..6cba299f 100644 --- a/src/components/code-snippet/code-snippet.tsx +++ b/src/components/code-snippet/code-snippet.tsx @@ -5,32 +5,33 @@ import * as React from 'react'; import { StyleRulesCallback, WithStyles, Typography, withStyles, Theme } from '@material-ui/core'; import { ArvadosTheme } from '~/common/custom-theme'; +import * as classNames from 'classnames'; type CssRules = 'root'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { boxSizing: 'border-box', - width: '100%', - height: 'auto', - maxHeight: '550px', - overflow: 'scroll', + overflow: 'auto', padding: theme.spacing.unit } }); export interface CodeSnippetDataProps { lines: string[]; + className?: string; } type CodeSnippetProps = CodeSnippetDataProps & WithStyles; export const CodeSnippet = withStyles(styles)( - ({ classes, lines }: CodeSnippetProps) => - + ({ classes, lines, className }: CodeSnippetProps) => + { lines.map((line: string, index: number) => { - return {line}; + return {line}; }) }