11import 'docs/src/bootstrap' ;
22// --- Post bootstrap -----
33import * as React from 'react' ;
4- import type { DocsAppProps } from '@mui/internal-core-docs/DocsApp' ;
54import {
65 DocsApp ,
76 createGetInitialProps ,
@@ -20,13 +19,7 @@ import xPages from 'docs/data/pages'; // DO NOT REMOVE
2019import { postProcessImport } from 'docs/src/modules/utils/postProcessImport' ;
2120import type { AppProps } from 'next/app' ;
2221import { useRouter } from 'next/router' ;
23- import {
24- LANGUAGES ,
25- LANGUAGES_SSR ,
26- LANGUAGES_IGNORE_PAGES ,
27- LANGUAGES_IN_PROGRESS ,
28- } from '@mui/internal-core-docs/constants' ;
29- import { DocsConfig } from '@mui/internal-core-docs/DocsProvider' ;
22+ import { DEFAULT_DOCS_CONFIG , DocsConfig } from '@mui/internal-core-docs/DocsProvider' ;
3023
3124export { fontClasses } from '@mui/internal-core-docs/nextFonts' ;
3225
@@ -47,7 +40,7 @@ function getMuiPackageVersion(packageName: string, commitRef?: string) {
4740 return `https://pkg.pr.new/mui/mui-x/@mui/${ packageName } @${ commitRef } ` ;
4841}
4942
50- function usePageData ( pageProps : DocsAppProps [ 'pageProps' ] ) {
43+ function usePageData ( ) {
5144 const router = useRouter ( ) ;
5245 const { productId : productIdRaw , productCategoryId } = getProductInfoFromUrl ( router . asPath ) ;
5346 const { canonicalAs } = pathnameToLanguage ( router . asPath ) ;
@@ -68,7 +61,6 @@ function usePageData(pageProps: DocsAppProps['pageProps']) {
6861
6962 return React . useMemo ( ( ) => {
7063 const { activePage, activePageParents } = findActivePage ( xPages , router . pathname ) ;
71- const languagePrefix = pageProps . userLanguage === 'en' ? '' : `/${ pageProps . userLanguage } ` ;
7264 const productIdMap : Record < string , { subpath : string ; version : string | undefined } > = {
7365 introduction : { subpath : '/x/introduction' , version : process . env . LIB_VERSION } ,
7466 'x-data-grid' : { subpath : '/x/react-data-grid' , version : process . env . DATA_GRID_VERSION } ,
@@ -88,12 +80,12 @@ function usePageData(pageProps: DocsAppProps['pageProps']) {
8880 return {
8981 current : true ,
9082 text : `v${ version } ` ,
91- href : `${ languagePrefix } ${ productIdMap [ id ] . subpath } /` ,
83+ href : `${ productIdMap [ id ] . subpath } /` ,
9284 } ;
9385 }
9486 return {
9587 text : version ,
96- href : `https://${ version } .mui.com${ languagePrefix } ${ productIdMap [ id ] . subpath } /` ,
88+ href : `https://${ version } .mui.com${ productIdMap [ id ] . subpath } /` ,
9789 } ;
9890 } ) ;
9991
@@ -102,7 +94,7 @@ function usePageData(pageProps: DocsAppProps['pageProps']) {
10294 name : 'MUI X' ,
10395 versions : [
10496 ...getVersionOptions ( 'introduction' , [ process . env . LIB_VERSION ! , 'v8' , 'v7' , 'v6' , 'v5' ] ) ,
105- { text : 'v4' , href : `https://v4.mui.com${ languagePrefix } /components/data-grid/` } ,
97+ { text : 'v4' , href : `https://v4.mui.com/components/data-grid/` } ,
10698 ] ,
10799 } ;
108100
@@ -118,7 +110,7 @@ function usePageData(pageProps: DocsAppProps['pageProps']) {
118110 'v6' ,
119111 'v5' ,
120112 ] ) ,
121- { text : 'v4' , href : `https://v4.mui.com${ languagePrefix } /components/data-grid/` } ,
113+ { text : 'v4' , href : `https://v4.mui.com/components/data-grid/` } ,
122114 ] ,
123115 } ;
124116 } else if ( productId === 'x-date-pickers' ) {
@@ -134,7 +126,7 @@ function usePageData(pageProps: DocsAppProps['pageProps']) {
134126 ] ) ,
135127 {
136128 text : 'v5' ,
137- href : `https://v5.mui.com${ languagePrefix } /x/react-date-pickers/getting-started/` ,
129+ href : `https://v5.mui.com/x/react-date-pickers/getting-started/` ,
138130 } ,
139131 ] ,
140132 } ;
@@ -152,7 +144,7 @@ function usePageData(pageProps: DocsAppProps['pageProps']) {
152144 ...getVersionOptions ( 'x-tree-view' , [ process . env . TREE_VIEW_VERSION ! , 'v8' , 'v7' ] ) ,
153145 {
154146 text : 'v6' ,
155- href : `https://v6.mui.com${ languagePrefix } /x/react-tree-view/getting-started` ,
147+ href : `https://v6.mui.com/x/react-tree-view/getting-started` ,
156148 } ,
157149 ] ,
158150 } ;
@@ -192,7 +184,7 @@ function usePageData(pageProps: DocsAppProps['pageProps']) {
192184 productId,
193185 productCategoryId,
194186 } ;
195- } , [ productId , productCategoryId , pageProps . userLanguage , router . pathname ] ) ;
187+ } , [ productId , productCategoryId , router . pathname ] ) ;
196188}
197189
198190const CSB_CONFIG = {
@@ -246,10 +238,7 @@ const CSB_CONFIG = {
246238} ;
247239
248240const DOCS_CONFIG : DocsConfig = {
249- LANGUAGES ,
250- LANGUAGES_SSR ,
251- LANGUAGES_IN_PROGRESS ,
252- LANGUAGES_IGNORE_PAGES ,
241+ ...DEFAULT_DOCS_CONFIG ,
253242} ;
254243
255244function useThemeWrapper ( ) {
@@ -264,7 +253,7 @@ export default function MyApp(
264253) {
265254 const { Component, pageProps } = props ;
266255 const { activePage, activePageParents, productIdentifier, productId, productCategoryId } =
267- usePageData ( pageProps ) ;
256+ usePageData ( ) ;
268257 const ThemeWrapper = useThemeWrapper ( ) ;
269258
270259 return (
0 commit comments