projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into 15530-wb2-logincluster
[arvados-workbench2.git]
/
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 6cba299f1580a70d8076afc98606af1479ab5fb1..84271f0ea3be2cbda6e364fd574f28adabd39aab 100644
(file)
--- a/
src/components/code-snippet/code-snippet.tsx
+++ b/
src/components/code-snippet/code-snippet.tsx
@@
-3,35
+3,39
@@
// SPDX-License-Identifier: AGPL-3.0
import * as React from 'react';
// SPDX-License-Identifier: AGPL-3.0
import * as React from 'react';
-import { StyleRulesCallback, WithStyles, Typography, withStyles
, Theme
} from '@material-ui/core';
+import { StyleRulesCallback, WithStyles, Typography, withStyles } from '@material-ui/core';
import { ArvadosTheme } from '~/common/custom-theme';
import * as classNames from 'classnames';
import { ArvadosTheme } from '~/common/custom-theme';
import * as classNames from 'classnames';
-type CssRules = 'root';
+type CssRules = 'root'
| 'space'
;
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
root: {
boxSizing: 'border-box',
overflow: 'auto',
padding: theme.spacing.unit
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
root: {
boxSizing: 'border-box',
overflow: 'auto',
padding: theme.spacing.unit
+ },
+ space: {
+ marginLeft: '15px'
}
});
export interface CodeSnippetDataProps {
lines: string[];
className?: string;
}
});
export interface CodeSnippetDataProps {
lines: string[];
className?: string;
+ apiResponse?: boolean;
}
type CodeSnippetProps = CodeSnippetDataProps & WithStyles<CssRules>;
export const CodeSnippet = withStyles(styles)(
}
type CodeSnippetProps = CodeSnippetDataProps & WithStyles<CssRules>;
export const CodeSnippet = withStyles(styles)(
- ({ classes, lines, className }: CodeSnippetProps) =>
+ ({ classes, lines, className
, apiResponse
}: CodeSnippetProps) =>
<Typography
component="div"
className={classNames(classes.root, className)}>
{
lines.map((line: string, index: number) => {
<Typography
component="div"
className={classNames(classes.root, className)}>
{
lines.map((line: string, index: number) => {
- return <Typography key={index} component="pre">{line}</Typography>;
+ return <Typography key={index} c
lassName={apiResponse ? classes.space : ''} c
omponent="pre">{line}</Typography>;
})
}
</Typography>
})
}
</Typography>