forked from MarquezProject/marquez
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSON formatting and highlighting (MarquezProject#1690)
* Adding JSON formatting and special case highlighting. Signed-off-by: Peter Hicks <[email protected]> * Moving to dependencies. Signed-off-by: Peter Hicks <[email protected]> * package-lock.json file updates. Signed-off-by: Peter Hicks <[email protected]> * Using different import for testing. Signed-off-by: Peter Hicks <[email protected]> * Fixing empty case handling. Signed-off-by: Peter Hicks <[email protected]> Co-authored-by: Peter Hicks <[email protected]>
- Loading branch information
Showing
6 changed files
with
218 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { THEME_EXTRA, theme } from '../../../helpers/theme' | ||
import { alpha } from '@material-ui/core/styles' | ||
import { ocean } from 'react-syntax-highlighter/dist/cjs/styles/hljs' | ||
import React from 'react' | ||
import SyntaxHighlighter from 'react-syntax-highlighter' | ||
|
||
interface OwnProps { | ||
code: object | ||
} | ||
|
||
const MqJson: React.FC<OwnProps> = ({ code }) => { | ||
return ( | ||
<SyntaxHighlighter | ||
language='json' | ||
style={ocean} | ||
customStyle={{ | ||
backgroundColor: alpha(theme.palette.common.white, 0.1), | ||
borderLeft: `2px dashed ${THEME_EXTRA.typography.subdued}` | ||
}} | ||
> | ||
{JSON.stringify(code, null, ' ')} | ||
</SyntaxHighlighter> | ||
) | ||
} | ||
|
||
export default MqJson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.