Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jun 26, 2023
1 parent b827f98 commit b64eeb1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions docs/src/modules/components/Demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ function useDemoData(codeVariant, demo, githubLocation, codeStyling) {
const { canonicalAs } = pathnameToLanguage(router.asPath);

return React.useMemo(() => {
let product;
let productId;
let name = 'Material UI';
if (canonicalAs.startsWith('/joy-ui/')) {
product = 'joy-ui';
productId = 'joy-ui';
name = 'Joy UI';
} else if (canonicalAs.startsWith('/base-ui/')) {
product = 'base-ui';
productId = 'base-ui';
name = 'Base UI';
} else if (canonicalAs.startsWith('/x/')) {
name = 'MUI X';
Expand Down Expand Up @@ -145,7 +145,7 @@ function useDemoData(codeVariant, demo, githubLocation, codeStyling) {
jsxPreview,
...codeOptions,
title: `${getDemoName(githubLocation)} demo — ${name}`,
product,
productId,
language: userLanguage,
codeStyling,
};
Expand Down Expand Up @@ -478,8 +478,8 @@ export default function Demo(props) {
const [showAd, setShowAd] = React.useState(false);
const adVisibility = showAd && !disableAd && !demoOptions.disableAd;

const DemoRoot = demoData.product === 'joy-ui' ? DemoRootJoy : DemoRootMaterial;
const Wrapper = demoData.product === 'joy-ui' ? BrandingProvider : React.Fragment;
const DemoRoot = demoData.productId === 'joy-ui' ? DemoRootJoy : DemoRootMaterial;
const Wrapper = demoData.productId === 'joy-ui' ? BrandingProvider : React.Fragment;

const isPreview = !codeOpen && showPreview;

Expand Down Expand Up @@ -532,7 +532,7 @@ export default function Demo(props) {
onMouseEnter={handleDemoHover}
onMouseLeave={handleDemoHover}
>
<Wrapper {...(demoData.product === 'joy-ui' && { mode })}>
<Wrapper {...(demoData.productId === 'joy-ui' && { mode })}>
<InitialFocus
aria-label={t('initialFocusLabel')}
action={initialFocusRef}
Expand All @@ -557,7 +557,7 @@ export default function Demo(props) {
))}
<AnchorLink id={`${demoName}.js`} />
<AnchorLink id={`${demoName}.tsx`} />
<Wrapper {...(demoData.product === 'joy-ui' ? { mode } : {})}>
<Wrapper {...(demoData.productId === 'joy-ui' ? { mode } : {})}>
{demoOptions.hideToolbar ? null : (
<NoSsr defer fallback={<DemoToolbarFallback />}>
<React.Suspense fallback={<DemoToolbarFallback />}>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/sandbox/Dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type RegExpMatchArrayWithGroups<T> = (RegExpMatchArray & RegExpMatchArrayWithGro
export default function SandboxDependencies(
demo: {
raw: string;
product?: 'joy-ui' | 'base-ui';
productId?: 'joy-ui' | 'base-ui';
codeVariant: keyof typeof CODE_VARIANTS;
},
options?: { commitRef?: string },
Expand Down Expand Up @@ -168,7 +168,7 @@ export default function SandboxDependencies(
dependencies.typescript = 'latest';
}

if (!demo.product && !dependencies['@mui/material']) {
if (!demo.productId && !dependencies['@mui/material']) {
// The `index.js` imports StyledEngineProvider from '@mui/material', so we need to make sure we have it as a dependency
const name = '@mui/material';
const versions = {
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/utils/getProductInfoFromUrl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ describe('getProductInfoFromUrl', () => {
// Now, it's a none goal to be able to handle this. Either change the URL to be
// /x/react-data-grid/migration-v5/
// or add the productId header to the markdown of this page.
productId: null,
productId: 'null',
});
});

it('should handle MUI Toolpad', () => {
expect(getProductInfoFromUrl('/toolpad/getting-started/first-app/')).to.deep.equal({
productCategoryId: null,
productCategoryId: 'null',
productId: 'toolpad',
});
});
Expand Down

0 comments on commit b64eeb1

Please sign in to comment.