Skip to content

Commit 867c791

Browse files
committed
fix: improve part of ui not covered by theme color
1 parent a173bd0 commit 867c791

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/components/DataTypes/Object.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,24 @@ const PreObjectType: FC<DataItemProps<object>> = (props) => {
7979

8080
const PostObjectType: FC<DataItemProps<object>> = (props) => {
8181
const metadataColor = useJsonViewerStore(store => store.colorspace.base04)
82+
const textColor = useTextColor()
8283
const isArray = useMemo(() => Array.isArray(props.value), [props.value])
8384
const isEmptyValue = useMemo(() => getValueSize(props.value) === 0, [props.value])
8485
const sizeOfValue = useMemo(() => inspectMetadata(props.value), [props.value])
8586
const displaySize = useJsonViewerStore(store => store.displaySize)
8687
const shouldDisplaySize = useMemo(() => typeof displaySize === 'function' ? displaySize(props.path, props.value) : displaySize, [displaySize, props.path, props.value])
8788

8889
return (
89-
<Box component='span' className='data-object-end'>
90+
<Box
91+
component='span'
92+
className='data-object-end'
93+
sx={{
94+
lineHeight: 1.5,
95+
color: textColor,
96+
letterSpacing: 0.5,
97+
opacity: 0.8
98+
}}
99+
>
90100
{isArray ? arrayRb : objectRb}
91101
{shouldDisplaySize && (isEmptyValue || !props.inspect)
92102
? (

src/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,18 @@ export const JsonViewer = function JsonViewer<Value> (props: JsonViewerProps<Val
145145
: themeType === 'dark'
146146
? darkColorspace.base00
147147
: lightColorspace.base00
148+
const foregroundColor = typeof themeType === 'object'
149+
? themeType.base07
150+
: themeType === 'dark'
151+
? darkColorspace.base07
152+
: lightColorspace.base07
148153
return createTheme({
149154
components: {
150155
MuiPaper: {
151156
styleOverrides: {
152157
root: {
153-
backgroundColor
158+
backgroundColor,
159+
color: foregroundColor
154160
}
155161
}
156162
}

0 commit comments

Comments
 (0)