Skip to content

Commit 67e3922

Browse files
author
phix
committed
Updating colors for json theme.
1 parent 6576fb3 commit 67e3922

4 files changed

Lines changed: 27 additions & 17 deletions

File tree

web/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@types/jest": "^29.5.2",
3131
"@types/react-router-dom": "^5.3.3",
3232
"@types/react-syntax-highlighter": "^15.5.6",
33-
"@uiw/react-json-view": "^2.0.0-alpha.11",
33+
"@uiw/react-json-view": "^2.0.0-alpha.24",
3434
"@visx/responsive": "3.10.2",
3535
"autoprefixer": "^10.4.14",
3636
"copy-webpack-plugin": "^10.2.4",

web/src/components/core/json-view/MqJsonView.tsx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
11
// SPDX-License-Identifier: Apache-2.0
22
import { Box } from '@mui/system'
3-
import { darkTheme } from '@uiw/react-json-view/dark'
4-
import { theme } from '../../../helpers/theme'
3+
import { THEME_EXTRA, theme } from '../../../helpers/theme'
4+
import { githubDarkTheme } from '@uiw/react-json-view/githubDark'
55
import JsonView from '@uiw/react-json-view'
66
import React from 'react'
77

88
interface OwnProps {
99
data: object
10-
searchable?: boolean
11-
placeholder?: string
1210
}
1311

1412
type JsonViewProps = OwnProps
1513

16-
darkTheme.background = theme.palette.background.default
17-
darkTheme.backgroundColor = theme.palette.background.default
18-
darkTheme.borderLeftWidth = 2
19-
darkTheme.borderLeftColor = theme.palette.grey[500]
20-
darkTheme.borderLeftStyle = 'dashed'
14+
githubDarkTheme.background = theme.palette.background.default
15+
githubDarkTheme.backgroundColor = theme.palette.background.default
16+
githubDarkTheme.borderLeftWidth = 2
17+
githubDarkTheme.borderLeftColor = theme.palette.grey[500]
18+
githubDarkTheme.borderLeftStyle = 'dashed'
19+
20+
const mqTheme = {
21+
...githubDarkTheme,
22+
'--w-rjv-info-color': THEME_EXTRA.typography.subdued,
23+
'--w-rjv-type-null-color': theme.palette.warning.main,
24+
'--w-rjv-type-boolean-color': theme.palette.error.main,
25+
'--w-rjv-copied-color': theme.palette.primary.main,
26+
'--w-rjv-key-string': theme.palette.common.white,
27+
'--w-rjv-type-string-color': theme.palette.info.main,
28+
'--w-rjv-ellipsis-color': theme.palette.info.main,
29+
'--w-rjv-key-number': theme.palette.primary.main,
30+
'--w-rjv-type-float-color': theme.palette.primary.main,
31+
}
2132

2233
const MqJsonView: React.FC<JsonViewProps> = ({ data }) => {
2334
return (
2435
<Box my={2}>
25-
<JsonView style={darkTheme} collapsed={2} value={data} />
36+
<JsonView style={mqTheme} collapsed={2} value={data} />
2637
</Box>
2738
)
2839
}

web/src/components/jobs/RunInfo.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const RunInfo: FunctionComponent<RunInfoProps> = (props) => {
5050
)
5151

5252
return (
53-
<Box mt={2}>
53+
<Box>
5454
{<MqCode code={(jobFacets?.sql as SqlFacet)?.query} language={'sql'} />}
5555
{run.facets && (
5656
<Box mt={2}>
@@ -61,7 +61,6 @@ const RunInfo: FunctionComponent<RunInfoProps> = (props) => {
6161
data={run.facets}
6262
aria-label={i18next.t('jobs.facets_subhead_aria')}
6363
aria-required='true'
64-
placeholder={i18next.t('jobs.search')}
6564
/>
6665
</Box>
6766
)}

0 commit comments

Comments
 (0)