Skip to content
Snippets Groups Projects
Commit 89da16f0 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixes the theming issue with the dev tools.

- I removed the ill fated custom dev tools theme.
- I used the right JSON component that respects the color mode.
parent ee87ff6d
No related branches found
No related tags found
1 merge request!101Misc small fixes
Pipeline #232656 passed
import { import {Box, Divider, Paper, Tab, Tabs} from '@mui/material'
Box,
Divider,
Paper,
Tab,
Tabs,
ThemeProvider,
createTheme,
} from '@mui/material'
import {Resizable} from 're-resizable' import {Resizable} from 're-resizable'
import React, {PropsWithChildren, useCallback, useMemo, useState} from 'react' import React, {PropsWithChildren, useCallback, useMemo, useState} from 'react'
import {SxProps} from '../../utils/types' import {SxProps} from '../../utils/types'
import {DevToolsContextValue, devToolsContext} from './useDevTools' import {DevToolsContextValue, devToolsContext} from './useDevTools'
const devToolsTheme = createTheme({
typography: {
fontFamily: 'sans-serif',
fontSize: 10,
},
spacing: 6,
palette: {
mode: 'light',
primary: {
main: '#E00',
},
secondary: {
main: '#EEE',
},
},
})
type DevToolsContainerProps = PropsWithChildren & { type DevToolsContainerProps = PropsWithChildren & {
defaultSize?: {width: number; height: number} defaultSize?: {width: number; height: number}
} & SxProps } & SxProps
...@@ -40,35 +15,33 @@ function DevToolsContainer({ ...@@ -40,35 +15,33 @@ function DevToolsContainer({
...paperProps ...paperProps
}: DevToolsContainerProps) { }: DevToolsContainerProps) {
return ( return (
<ThemeProvider theme={devToolsTheme}> <Paper
<Paper elevation={3}
elevation={3} sx={{
sx={{ position: 'fixed',
position: 'fixed', bottom: 16,
bottom: 16, left: 81,
left: 81, zIndex: 10000,
zIndex: 10000, ...(paperProps.sx || {}),
...(paperProps.sx || {}), }}
{...paperProps}
>
<Resizable
defaultSize={
defaultSize || {
width: 320,
height: 500,
}
}
style={{
position: 'initial',
display: 'flex',
flexDirection: 'column',
}} }}
{...paperProps}
> >
<Resizable {children}
defaultSize={ </Resizable>
defaultSize || { </Paper>
width: 320,
height: 500,
}
}
style={{
position: 'initial',
display: 'flex',
flexDirection: 'column',
}}
>
{children}
</Resizable>
</Paper>
</ThemeProvider>
) )
} }
......
import {Box} from '@mui/material' import {Box} from '@mui/material'
import {JsonViewer, JsonViewerProps, defineDataType} from '@textea/json-viewer' import {JsonViewerProps, defineDataType} from '@textea/json-viewer'
import JsonViewer from '../fileviewer/JsonViewer'
const otherDataType = defineDataType({ const otherDataType = defineDataType({
is: (value) => { is: (value) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment