diff --git a/src/components/Changeset/ChangesetBanner.tsx b/src/components/Changeset/ChangesetBanner.tsx index 230cace426..bd127d4aa1 100644 --- a/src/components/Changeset/ChangesetBanner.tsx +++ b/src/components/Changeset/ChangesetBanner.tsx @@ -4,16 +4,8 @@ import { Edit as EditIcon, } from '@mui/icons-material'; import { Alert, AlertTitle, Tooltip } from '@mui/material'; -import { makeStyles } from 'tss-react/mui'; import { IconButton } from '../IconButton'; -const useStyles = makeStyles()(({ spacing, breakpoints }) => ({ - root: { - maxWidth: breakpoints.values.md, - margin: spacing(0, 2), - }, -})); - interface Props { changesetId: string | undefined; onEdit?: () => void; @@ -21,8 +13,6 @@ interface Props { } export const ChangesetBanner = (props: Props) => { - const { classes } = useStyles(); - if (!props.changesetId) { return null; } @@ -30,7 +20,10 @@ export const ChangesetBanner = (props: Props) => { } - className={classes.root} + sx={(theme) => ({ + maxWidth: theme.breakpoints.values.md, + margin: theme.spacing(0, 2), + })} action={ <> {props.onEdit && ( diff --git a/src/components/Debug/Code.tsx b/src/components/Debug/Code.tsx index 6b71b084f0..4f98e956eb 100644 --- a/src/components/Debug/Code.tsx +++ b/src/components/Debug/Code.tsx @@ -1,6 +1,6 @@ import { Box, BoxProps } from '@mui/material'; import { styled } from '@mui/material/styles'; -import { ChildrenProp } from '~/common'; +import { ChildrenProp, extendSx } from '~/common'; interface CodeProps extends Omit { json?: any; @@ -15,18 +15,15 @@ export const Code = ({ return ( ({ + padding: theme.spacing(1), + borderRadius: theme.shape.borderRadius, + color: theme.palette.background.paper, + backgroundColor: theme.palette.grey[800], + }), + ...extendSx(sx), + ]} {...rest} > {json ? JSON.stringify(json, undefined, 2) : children} diff --git a/src/components/Error/Error.tsx b/src/components/Error/Error.tsx index 9ad0d2b801..fb2bcdeb5a 100644 --- a/src/components/Error/Error.tsx +++ b/src/components/Error/Error.tsx @@ -1,25 +1,15 @@ import { ApolloError } from '@apollo/client'; import { Button, Grid, Typography } from '@mui/material'; +import { useTheme } from '@mui/material/styles'; import { usePrevious } from 'ahooks'; import { isPlainObject } from 'lodash'; import { ElementType, isValidElement, ReactNode, useEffect } from 'react'; import { useErrorBoundary } from 'react-error-boundary'; import { useLocation } from 'react-router-dom'; -import { makeStyles } from 'tss-react/mui'; import { getErrorInfo } from '~/api'; import { ButtonLink, StatusCode, useNavigate } from '../Routing'; import { ErrorRenderers, renderError } from './error-handling'; -const useStyles = makeStyles()(({ spacing }) => ({ - page: { - overflow: 'auto', - padding: spacing(4, 0, 0, 4), - }, - buttons: { - marginTop: spacing(3), - }, -})); - export interface ErrorProps { /** * The error body to display. @@ -62,8 +52,8 @@ export const Error = ({ disableButtons, component: Component = 'div', }: ErrorProps) => { - const { classes, cx } = useStyles(); const navigate = useNavigate(); + const theme = useTheme(); useResetErrorOnLocationChange(); @@ -87,14 +77,23 @@ export const Error = ({ error && getErrorInfo(error).codes.includes('NotFound') ? 404 : 500; return ( - + {/* Default status code to be helpful for the most common ones. The children can still override this by rendering themselves */} Oops, Sorry. {rendered} {!disableButtons && ( - +