Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[website] Fix home page dark mode flicker #33545

Merged
merged 144 commits into from Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
25cee16
create BrandingCssVarsProvider
siriwatknp Jul 7, 2022
048c826
replace with Css vars
siriwatknp Jul 7, 2022
f9faf82
update task card
siriwatknp Jul 7, 2022
7ed9c48
add resolveTheme prop
siriwatknp Jul 7, 2022
7c70d83
use CSS variables in Button theme
siriwatknp Jul 7, 2022
ca526f6
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Jul 14, 2022
9ae7cb5
add getInitColorSchemeScript to index
siriwatknp Jul 14, 2022
1ddc314
adjust ssr toggle mode
siriwatknp Jul 14, 2022
0e838bf
fix display1 color
siriwatknp Jul 14, 2022
fdc2244
update IconButton branding theme
siriwatknp Jul 14, 2022
6980915
update Menu branding theme
siriwatknp Jul 14, 2022
ca82846
update Popover branding theme
siriwatknp Jul 14, 2022
46b015f
update Divider, Link brandingTheme
siriwatknp Jul 14, 2022
0f51305
update Chip, TableCell, ToggleButtonGroup branding theme
siriwatknp Jul 14, 2022
6221a07
update ToggleButton branding theme
siriwatknp Jul 14, 2022
3307249
update Switch, Pagination branding theme
siriwatknp Jul 14, 2022
84d9e39
add getMuiInitColorSchemeScript to _document
siriwatknp Jul 14, 2022
6203813
update AppHeader
siriwatknp Jul 15, 2022
c9364f2
update Paper theme
siriwatknp Jul 15, 2022
eec0711
fix button theme
siriwatknp Jul 15, 2022
0f868bc
update homepage theme
siriwatknp Jul 15, 2022
bcf5bdd
use callback syntax
siriwatknp Jul 15, 2022
c428aa2
remove theme argument
siriwatknp Jul 15, 2022
2b83a8d
remove resolveTheme from prop
siriwatknp Jul 15, 2022
eca4e88
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Jul 15, 2022
06103a0
fix types
siriwatknp Jul 15, 2022
cd73a4c
update ThemeToggleButton
siriwatknp Jul 16, 2022
8acdb09
update ThemeSwitch
siriwatknp Jul 16, 2022
a4ff446
update ThemeChip
siriwatknp Jul 16, 2022
4b6dc1e
update ThemeTimeline
siriwatknp Jul 16, 2022
a408db7
update ThemeDatePicker
siriwatknp Jul 16, 2022
2f6ccc4
adjust styles
siriwatknp Jul 16, 2022
1f291ed
update ThemeTabs
siriwatknp Jul 16, 2022
4c2963a
update ThemeSlider
siriwatknp Jul 16, 2022
e123b69
update NotificationCard
siriwatknp Jul 16, 2022
5e3e76d
update ThemeAccordion
siriwatknp Jul 16, 2022
eba12c7
minor fix styles
siriwatknp Jul 16, 2022
0bc86a1
create first set of variables
siriwatknp Jul 16, 2022
63cf0c5
fix StylingInfo
siriwatknp Jul 17, 2022
6d29b50
Fix CoreShowcase
siriwatknp Jul 17, 2022
26e0d16
Update Testimonials
siriwatknp Jul 17, 2022
e9b8934
update PlayerCard
siriwatknp Jul 17, 2022
9a1526e
fix components ssr
siriwatknp Jul 17, 2022
0d8b5b1
Fix all SSR hydration mismatch
siriwatknp Jul 17, 2022
d675938
add getStyle util
siriwatknp Jul 17, 2022
eec94fa
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Jul 17, 2022
ead1c86
simplify code
siriwatknp Jul 17, 2022
32dad42
fix typo
siriwatknp Jul 17, 2022
5198539
Merge branch 'master' into docs/home-improve
siriwatknp Jul 18, 2022
d4bdda7
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Aug 4, 2022
c82254c
refactor getStyle
siriwatknp Aug 4, 2022
0a600e0
add disableTransitionOnChange
siriwatknp Aug 4, 2022
720cf92
add comment
siriwatknp Aug 5, 2022
bb46f5a
fix EmailSubscribe
siriwatknp Aug 5, 2022
1687f91
use specific values
siriwatknp Aug 5, 2022
12a2b80
fix styles
siriwatknp Aug 5, 2022
85f9b3b
refactor getStyle
siriwatknp Aug 5, 2022
b9dc946
fix color
siriwatknp Aug 5, 2022
bf88a94
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Aug 8, 2022
2a683dc
add custom stylis plugins
siriwatknp Aug 8, 2022
6e17c5e
use :where selector
siriwatknp Aug 8, 2022
09931d0
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Aug 9, 2022
f67d32c
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Aug 9, 2022
567fc7a
use getColorSchemeSelector in components
siriwatknp Aug 9, 2022
95a75fd
fix brandingTheme
siriwatknp Aug 9, 2022
d3e8c5b
use applyDarkStyles
siriwatknp Aug 9, 2022
ef4809a
fix
siriwatknp Aug 9, 2022
ae7e79a
fix edge cases
siriwatknp Aug 9, 2022
09cc30c
sync local storage with other pages
siriwatknp Aug 9, 2022
e8bb374
fix style
siriwatknp Aug 9, 2022
c7b6299
remove custom tokens
siriwatknp Aug 9, 2022
5b67285
revert change
siriwatknp Aug 9, 2022
7eea262
use applyDarkStyles
siriwatknp Aug 9, 2022
dfad161
remove custom keys
siriwatknp Aug 9, 2022
e84faea
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Aug 16, 2022
35d4f53
exclude vars
siriwatknp Aug 16, 2022
f27c144
remove unnecessary color scheme
siriwatknp Aug 16, 2022
439fc56
syncing local storage with the homepage
siriwatknp Aug 16, 2022
5271159
fix variables
siriwatknp Aug 16, 2022
0178970
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Oct 5, 2022
9b5a49d
remove unnecessary tokens
siriwatknp Oct 5, 2022
906c5a0
remove joy color scheme script setup
siriwatknp Oct 5, 2022
5276619
fix color scheme reset
siriwatknp Oct 5, 2022
ce247db
revert change
siriwatknp Oct 5, 2022
3d84d40
ensure consistent color-scheme
siriwatknp Oct 5, 2022
76b5e8b
add box-shadow
siriwatknp Oct 5, 2022
1712381
prettier
siriwatknp Oct 5, 2022
3b92ce5
make all marketing components use theme.applyDarkStyles
siriwatknp Oct 6, 2022
962bab6
add comment
siriwatknp Oct 6, 2022
88bd060
add resolved mode and add comments
siriwatknp Oct 6, 2022
b1fa4d8
remove unnecessary enableColorScheme
siriwatknp Oct 6, 2022
1964a6b
use palette.mode as color-scheme
siriwatknp Oct 6, 2022
b69e21b
add mode to palette in joy
siriwatknp Oct 6, 2022
d971b0b
remove enableColorScheme test (moved to regression)
siriwatknp Oct 6, 2022
119858c
fix joy dark mode
siriwatknp Oct 6, 2022
c1ae81a
remove omit
siriwatknp Oct 6, 2022
fd3268c
add initial setup from design system
siriwatknp Oct 6, 2022
317b915
revert to make code review easier
siriwatknp Oct 6, 2022
4376b81
Merge branch 'system/fix-server-mode' into docs/home-improve
siriwatknp Oct 6, 2022
51fa80e
move enable color scheme to CssBaseline
siriwatknp Oct 6, 2022
a79c794
Add CssBaseline to Joy
siriwatknp Oct 6, 2022
0e9a4a0
Merge branch 'system/fix-server-mode' into docs/home-improve
siriwatknp Oct 6, 2022
e2bbb60
remove color scheme inline style
siriwatknp Oct 6, 2022
8885f0f
fix color scheme styles generation
siriwatknp Oct 6, 2022
eea5765
Remove workaround adjustment
siriwatknp Oct 6, 2022
1da43e6
run proptypes
siriwatknp Oct 6, 2022
e47b24e
fix lint
siriwatknp Oct 6, 2022
b5da1b6
run proptypes
siriwatknp Oct 6, 2022
88b48f7
fix lint
siriwatknp Oct 6, 2022
23c27ee
fix backdrop color
siriwatknp Oct 7, 2022
bea2b11
fix Joy color scheme styles
siriwatknp Oct 7, 2022
784a5f6
add visual regression
siriwatknp Oct 7, 2022
4ae0ff0
fix color scheme styles generation
siriwatknp Oct 6, 2022
d7456f9
fix implementation
siriwatknp Oct 7, 2022
4187694
apply logic to ScopedCssBaseline
siriwatknp Oct 7, 2022
fb0a14b
update regression
siriwatknp Oct 7, 2022
65eaac9
fix mui CssBaseline
siriwatknp Oct 7, 2022
c07acb7
Merge branch 'system/fix-server-mode' into docs/home-improve
siriwatknp Oct 7, 2022
50fe080
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Oct 11, 2022
6fa572a
restore changes
siriwatknp Oct 11, 2022
d65c8bf
Remove unnecessary workaround
siriwatknp Oct 11, 2022
24b2751
remove outdated param
siriwatknp Oct 11, 2022
db9c81c
Remove paletteMode from cookie
siriwatknp Oct 11, 2022
7a22541
sync modes
siriwatknp Oct 11, 2022
7c02d2e
Fix description
oliviertassinari Oct 11, 2022
e9d99c4
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Oct 12, 2022
3315cb7
refactor to function syntax
siriwatknp Oct 12, 2022
3fdaa08
remove repeatitive logic
siriwatknp Oct 12, 2022
ef8171f
Merge branch 'docs/home-improve' of github.com:siriwatknp/material-ui…
siriwatknp Oct 12, 2022
0bb0546
fix hydration mismatch
siriwatknp Oct 12, 2022
857d5ab
force `vars` to be null
siriwatknp Oct 12, 2022
b164c9d
fix layout shift and precise why
oliviertassinari Oct 12, 2022
4529fc4
use try catch
siriwatknp Oct 16, 2022
83f2ece
use :where selector
siriwatknp Oct 16, 2022
02382a5
use applyDarkStyles
siriwatknp Oct 16, 2022
15baccb
fix lineHeight
siriwatknp Oct 16, 2022
c8371d6
use applyDarkStyles
siriwatknp Oct 16, 2022
0a0e25f
add grey palette
siriwatknp Oct 16, 2022
fa8b232
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Oct 16, 2022
fc7e12a
use applyDarkStyles
siriwatknp Oct 16, 2022
f51f4d4
Merge branch 'docs/home-improve' of github.com:siriwatknp/material-ui…
siriwatknp Oct 16, 2022
adfbbd3
fix lint
siriwatknp Oct 16, 2022
ff770b0
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp Oct 17, 2022
6fd0753
fix unsupported arg
siriwatknp Oct 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/pages/_document.js
Expand Up @@ -7,7 +7,7 @@ import { pathnameToLanguage } from 'docs/src/modules/utils/helpers';
import createEmotionCache from 'docs/src/createEmotionCache';
import { getMetaThemeColor } from 'docs/src/modules/brandingTheme';
import GlobalStyles from '@mui/material/GlobalStyles';
import { getInitColorSchemeScript } from '@mui/joy/styles';
import { getInitColorSchemeScript as getMuiInitColorSchemeScript } from '@mui/material/styles';

// You can find a benchmark of the available CSS minifiers under
// https://github.com/GoalSmashers/css-minification-benchmark
Expand Down Expand Up @@ -143,7 +143,7 @@ export default class MyDocument extends Document {
/>
</Head>
<body>
{getInitColorSchemeScript({ enableSystem: true })}
{getMuiInitColorSchemeScript()}
<Main />
<script
// eslint-disable-next-line react/no-danger
Expand Down
6 changes: 3 additions & 3 deletions docs/pages/index.tsx
Expand Up @@ -12,13 +12,13 @@ import Testimonials from 'docs/src/components/home/Testimonials';
import Sponsors from 'docs/src/components/home/Sponsors';
import HeroEnd from 'docs/src/components/home/HeroEnd';
import AppFooter from 'docs/src/layouts/AppFooter';
import BrandingProvider from 'docs/src/BrandingProvider';
import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider';
import NewsletterToast from 'docs/src/components/home/NewsletterToast';
import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner';

export default function Home() {
return (
<BrandingProvider>
<BrandingCssVarsProvider>
<Head
title="MUI: The React component library you always wanted"
description="MUI provides a simple, customizable, and accessible library of React components. Follow your own design system, or start with Material Design."
Expand Down Expand Up @@ -60,6 +60,6 @@ export default function Home() {
`,
}}
/>
</BrandingProvider>
</BrandingCssVarsProvider>
);
}
60 changes: 60 additions & 0 deletions docs/src/BrandingCssVarsProvider.tsx
@@ -0,0 +1,60 @@
import * as React from 'react';
import { deepmerge } from '@mui/utils';
import {
Experimental_CssVarsProvider as CssVarsProvider,
experimental_extendTheme as extendTheme,
PaletteColorOptions,
} from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import { NextNProgressBar } from 'docs/src/modules/components/AppFrame';
import { getDesignTokens, getThemedComponents } from 'docs/src/modules/brandingTheme';

declare module '@mui/material/styles' {
interface PaletteOptions {
primaryDark?: PaletteColorOptions;
}
}

const { palette: lightPalette, typography, ...designTokens } = getDesignTokens('light');
const { palette: darkPalette } = getDesignTokens('dark');

const theme = extendTheme({
cssVarPrefix: 'muidocs',
colorSchemes: {
light: {
palette: lightPalette,
},
dark: {
palette: darkPalette,
},
},
...designTokens,
typography: deepmerge(typography, {
h1: {
':where([data-mui-color-scheme="dark"]) &': {
color: 'initial',
},
},
h2: {
':where([data-mui-color-scheme="dark"]) &': {
color: 'var(--muidocs-palette-grey-100)',
},
},
h5: {
':where([data-mui-color-scheme="dark"]) &': {
color: 'var(--muidocs-palette-primary-300)',
},
},
}),
...getThemedComponents(),
});

export default function BrandingCssVarsProvider({ children }: { children: React.ReactNode }) {
return (
<CssVarsProvider theme={theme} disableTransitionOnChange>
<NextNProgressBar />
<CssBaseline />
{children}
</CssVarsProvider>
);
}
15 changes: 8 additions & 7 deletions docs/src/BrandingProvider.tsx
@@ -1,5 +1,4 @@
import * as React from 'react';
import { deepmerge } from '@mui/utils';
import { ThemeProvider, useTheme, createTheme } from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import { getDesignTokens, getThemedComponents } from 'docs/src/modules/brandingTheme';
Expand All @@ -18,12 +17,14 @@ export default function BrandingProvider(props: BrandingProviderProps) {
const { children, mode: modeProp } = props;
const upperTheme = useTheme();
const mode = modeProp || upperTheme.palette.mode;
const theme = React.useMemo(() => {
const designTokens = getDesignTokens(mode);
let newTheme = createTheme(designTokens);
newTheme = deepmerge(newTheme, getThemedComponents(newTheme));
return newTheme;
}, [mode]);
const theme = React.useMemo(
() =>
createTheme({
...getDesignTokens(mode),
...getThemedComponents(),
}),
[mode],
);
Comment on lines +20 to +27
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify the logic and remove deepmerge calculation.

return (
<ThemeProvider theme={modeProp ? () => theme : theme}>
{modeProp ? null : <NextNProgressBar />}
Expand Down
46 changes: 30 additions & 16 deletions docs/src/components/action/ArrowButton.tsx
Expand Up @@ -16,23 +16,37 @@ export default function ArrowButton({
size="small"
aria-label={label[direction]}
{...props}
sx={{
color: (theme) => (theme.palette.mode === 'dark' ? '#fff' : 'primary.main'),
border: '1px solid',
borderColor: (theme) => (theme.palette.mode === 'dark' ? 'primaryDark.300' : 'grey.200'),
'&:hover': {
borderColor: (theme) => (theme.palette.mode === 'dark' ? 'primaryDark.200' : 'grey.300'),
sx={[
{
border: '1px solid',
color: 'primary.main',
borderColor: 'grey.200',
'&:hover': {
borderColor: 'grey.300',
},
'&.Mui-disabled': {
opacity: 0.5,
color: 'grey.700',
borderColor: 'grey.300',
},
'& + .MuiIconButton-root': {
ml: 2,
},
},
'&.Mui-disabled': {
opacity: 0.5,
color: (theme) => (theme.palette.mode === 'dark' ? '#fff' : 'grey.700'),
borderColor: (theme) => (theme.palette.mode === 'dark' ? 'primary.700' : 'grey.300'),
},
'& + .MuiIconButton-root': {
ml: 2,
},
...props.sx,
}}
(theme) =>
theme.applyDarkStyles({
color: '#fff',
borderColor: 'primaryDark.300',
'&:hover': {
borderColor: 'primaryDark.200',
},
'&.Mui-disabled': {
color: '#fff',
borderColor: 'primary.700',
},
}),
...(Array.isArray(props.sx) ? props.sx : [props.sx]),
]}
>
{direction === 'left' && <KeyboardArrowLeftRounded fontSize="small" />}
{direction === 'right' && <KeyboardArrowRightRounded fontSize="small" />}
Expand Down
79 changes: 50 additions & 29 deletions docs/src/components/action/Highlighter.tsx
Expand Up @@ -5,6 +5,7 @@ export default function Highlighter({
disableBorder = false,
selected = false,
selectedBg = 'white',
sx,
...props
}: {
disableBorder?: boolean;
Expand Down Expand Up @@ -36,38 +37,58 @@ export default function Highlighter({
props.onFocusVisible(event);
}
}}
sx={{
justifyContent: 'flex-start',
textAlign: 'left',
alignItems: 'center',
borderRadius: 1,
height: '100%',
border: '1px solid transparent',
transitionProperty: 'all',
transitionDuration: '150ms',
color: (theme) => (theme.palette.mode === 'dark' ? 'primary.800' : 'primary.300'),
...((!disableBorder || selected) && {
borderColor: (theme) => (theme.palette.mode === 'dark' ? 'primaryDark.500' : 'grey.200'),
}),
...(selected && {
bgcolor: (theme) =>
theme.palette.mode === 'dark' ? 'primaryDark.700' : lightSelectedBg[selectedBg],
borderColor: (theme) => (theme.palette.mode === 'dark' ? 'primaryDark.300' : 'grey.200'),
color: (theme) => (theme.palette.mode === 'dark' ? 'primary.300' : 'primary.500'),
}),
...(!selected && {
'&:hover, &:focus': {
bgcolor: (theme) => (theme.palette.mode === 'dark' ? 'primaryDark.800' : 'grey.100'),
'@media (hover: none)': {
bgcolor: 'transparent',
sx={[
(theme) => ({
justifyContent: 'flex-start',
textAlign: 'left',
alignItems: 'center',
borderRadius: 1,
height: '100%',
border: '1px solid transparent',
transitionProperty: 'all',
transitionDuration: '150ms',
color: 'primary.300',
...((!disableBorder || selected) && {
borderColor: 'grey.200',
}),
...(selected && {
bgcolor: lightSelectedBg[selectedBg],
borderColor: 'grey.200',
color: 'primary.500',
}),
...(!selected && {
'&:hover, &:focus': {
bgcolor: 'grey.100',
'@media (hover: none)': {
bgcolor: 'transparent',
},
},
}),
...theme.applyDarkStyles({
color: 'primary.800',
...((!disableBorder || selected) && {
borderColor: 'primaryDark.500',
}),
...(selected && {
bgcolor: 'primaryDark.700',
borderColor: 'primaryDark.300',
color: 'primary.300',
}),
...(!selected && {
'&:hover, &:focus': {
bgcolor: 'primaryDark.800',
'@media (hover: none)': {
bgcolor: 'transparent',
},
},
}),
}),
'&.Mui-disabled': {
opacity: 0.4,
},
}),
'&.Mui-disabled': {
opacity: 0.4,
},
...props.sx,
}}
...(Array.isArray(sx) ? sx : [sx]),
]}
/>
);
}
87 changes: 42 additions & 45 deletions docs/src/components/action/StylingInfo.tsx
@@ -1,12 +1,11 @@
import * as React from 'react';
import { ThemeProvider, alpha } from '@mui/material/styles';
import { alpha } from '@mui/material/styles';
import Box, { BoxProps } from '@mui/material/Box';
import IconButton from '@mui/material/IconButton';
import Typography from '@mui/material/Typography';
import KeyboardArrowUpRounded from '@mui/icons-material/KeyboardArrowUpRounded';
import KeyboardArrowDownRounded from '@mui/icons-material/KeyboardArrowDownRounded';
import Link from 'docs/src/modules/components/Link';
import { brandingDarkTheme } from 'docs/src/modules/brandingTheme';
import ROUTES from 'docs/src/route';

export default function StylingInfo({
Expand All @@ -30,53 +29,51 @@ export default function StylingInfo({
</React.Fragment>
);
return (
<ThemeProvider theme={brandingDarkTheme}>
<Box
{...props}
<Box
{...props}
sx={{
position: 'absolute',
bottom: 0,
transform: hidden || !appeared ? 'translateY(100%)' : 'translateY(0)',
transition: '0.3s',
left: 0,
right: 0,
px: 2,
pt: 1,
pb: 2,
bgcolor: ({ palette }) => alpha(palette.primaryDark[700], 0.5),
backdropFilter: 'blur(8px)',
zIndex: 1,
borderTop: '1px solid',
borderColor: 'divider',
borderRadius: '0 0 10px 10px',
...props.sx,
}}
>
<IconButton
aria-label={hidden ? 'show' : 'hide'}
onClick={() => setHidden((bool) => !bool)}
sx={{
position: 'absolute',
bottom: 0,
transform: hidden || !appeared ? 'translateY(100%)' : 'translateY(0)',
zIndex: 2,
transition: '0.3s',
left: 0,
right: 0,
px: 2,
pt: 1,
pb: 2,
bgcolor: ({ palette }) => alpha(palette.primaryDark[700], 0.5),
backdropFilter: 'blur(8px)',
zIndex: 1,
borderTop: '1px solid',
borderColor: 'divider',
borderRadius: '0 0 10px 10px',
...props.sx,
right: 10,
bottom: '100%',
transform: hidden || !appeared ? 'translateY(-10px)' : 'translateY(50%)',
opacity: appeared ? 1 : 0,
bgcolor: 'primaryDark.500',
'&:hover, &.Mui-focused': {
bgcolor: 'primaryDark.600',
},
}}
>
<IconButton
aria-label={hidden ? 'show' : 'hide'}
onClick={() => setHidden((bool) => !bool)}
sx={{
position: 'absolute',
zIndex: 2,
transition: '0.3s',
right: 10,
bottom: '100%',
transform: hidden || !appeared ? 'translateY(-10px)' : 'translateY(50%)',
opacity: appeared ? 1 : 0,
bgcolor: 'primaryDark.500',
'&:hover, &.Mui-focused': {
bgcolor: 'primaryDark.600',
},
}}
>
{hidden ? (
<KeyboardArrowUpRounded fontSize="small" />
) : (
<KeyboardArrowDownRounded fontSize="small" />
)}
</IconButton>
{content || defaultContent}
</Box>
</ThemeProvider>
{hidden ? (
<KeyboardArrowUpRounded fontSize="small" />
) : (
<KeyboardArrowDownRounded fontSize="small" />
)}
</IconButton>
{content || defaultContent}
</Box>
);
}