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

[docs] Fix branding theme tabs and navigation bar regressions #37362

Merged
Prev Previous commit
Next Next commit
use styled utility instead of sx prop for Base UI documentation tabs
  • Loading branch information
ZeeshanTamboli committed May 22, 2023
commit c549988943b052911daf73cca0f7c24b3adb3d27
14 changes: 6 additions & 8 deletions docs/src/modules/components/ComponentPageTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import { useRouter } from 'next/router';
import { useTranslate } from 'docs/src/modules/utils/i18n';
import { styled } from '@mui/material/styles';
import Box from '@mui/material/Box';
import Tabs, { tabsClasses } from '@mui/material/Tabs';
import Tab, { tabClasses } from '@mui/material/Tab';
import Link from 'docs/src/modules/components/Link';

export const HEIGHT = 50;

const tabSxProp = (theme) => ({
const StyledTab = styled(Tab)(({ theme }) => ({
padding: theme.spacing(1),
marginBottom: theme.spacing(1),
marginRight: theme.spacing(1),
Expand All @@ -28,7 +29,7 @@ const tabSxProp = (theme) => ({
color: (theme.vars || theme).palette.primary[300],
},
}),
});
}));

export default function ComponentPageTabs(props) {
const {
Expand Down Expand Up @@ -81,33 +82,30 @@ export default function ComponentPageTabs(props) {
},
}}
>
<Tab
<StyledTab
component={Link}
shallow
scroll
href={demosHref}
label={t('api-docs.demos')}
value=""
sx={tabSxProp}
/>
<Tab
<StyledTab
component={Link}
shallow
scroll
href={componentsHref}
label={t('api-docs.componentsApi')}
value="components-api"
sx={tabSxProp}
/>
{headers.hooks && headers.hooks.length > 0 && (
<Tab
<StyledTab
component={Link}
shallow
scroll
href={hooksHref}
label={t('api-docs.hooksApi')}
value="hooks-api"
sx={tabSxProp}
/>
)}
</Tabs>
Expand Down