Skip to content

Commit

Permalink
[core] Migrate outdated pattern to convention
Browse files Browse the repository at this point in the history
These are trivial changes to match our latest coding conventions.
  • Loading branch information
oliviertassinari committed Oct 30, 2022
1 parent a10bb4f commit 5a84b55
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
6 changes: 3 additions & 3 deletions docs/pages/about.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import Head from 'docs/src/modules/components/Head';
import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
import { ThemeProvider } from '@mui/material/styles';
import Avatar from '@mui/material/Avatar';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
Expand Down Expand Up @@ -674,7 +674,7 @@ function AboutContent() {
</Grid>
</Box>
</Container>
<MuiThemeProvider theme={brandingDarkTheme}>
<ThemeProvider theme={brandingDarkTheme}>
<Box sx={{ bgcolor: 'primaryDark.700' }}>
<Container sx={{ py: { xs: 4, sm: 8 } }}>
<Typography
Expand Down Expand Up @@ -722,7 +722,7 @@ function AboutContent() {
</Box>
</Container>
</Box>
</MuiThemeProvider>
</ThemeProvider>
<Container sx={{ py: { xs: 4, md: 8 } }}>
<Typography variant="h2" sx={{ mt: 1, mb: { xs: 2, sm: 4 } }}>
How can you support us?
Expand Down
11 changes: 3 additions & 8 deletions docs/src/modules/components/AppLayoutDocsFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ const FeedbackGrid = styled(Grid)(({ theme }) => {
};
});

const FeedbackMessage = styled(Typography)(({ theme }) => {
return {
margin: theme.spacing(0, 2),
};
});

/**
* @typedef {import('docs/src/pages').MuiPage} MuiPage
* @typedef {import('docs/src/pages').OrderedMuiPage} OrderedMuiPage
Expand Down Expand Up @@ -340,14 +334,15 @@ export default function AppLayoutDocsFooter() {
alignItems="center"
aria-labelledby="feedback-message"
>
<FeedbackMessage
<Typography
align="center"
component="div"
id="feedback-message"
variant="body2"
sx={{ mx: 2 }}
>
{t('feedbackMessage')}
</FeedbackMessage>
</Typography>
<div>
<Tooltip title={t('feedbackYes')}>
<IconButton onClick={handleClickThumb(1)} aria-pressed={rating === 1}>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/components/HighlightedCode.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import * as React from 'react';
import { expect } from 'chai';
import { createRenderer } from 'test/utils';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import { getDesignTokens } from '../brandingTheme';
import HighlightedCode from './HighlightedCode';
import { getDesignTokens } from 'docs/src/modules/brandingTheme';
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';

describe('HighlightedCode', () => {
const { render } = createRenderer();
Expand Down
6 changes: 3 additions & 3 deletions docs/src/modules/components/MarkdownElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,13 @@ const Root = styled('div')(({ theme }) => ({
'& details': {
marginBottom: theme.spacing(1.5),
padding: theme.spacing(0.5, 0, 0.5, 1),
'& summary': {
cursor: 'pointer',
},
'& pre': {
marginTop: theme.spacing(1),
},
},
'& summary': {
cursor: 'pointer',
},
'& .MuiCode-root': {
position: 'relative',
'&:hover': {
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/utils/CodeCopy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const CodeBlockContext = React.createContext<React.MutableRefObject<HTMLDivEleme
* <button className="MuiCode-copy">...</button>
* </div>
*/
export const useCodeCopy = () => {
export function useCodeCopy() {
const rootNode = React.useContext(CodeBlockContext);
return {
onMouseEnter: (event: React.MouseEvent) => {
Expand All @@ -36,7 +36,7 @@ export const useCodeCopy = () => {
}
},
};
};
}

function InitCodeCopy() {
const rootNode = React.useContext(CodeBlockContext);
Expand Down

0 comments on commit 5a84b55

Please sign in to comment.