From c53f4e592903764587ae72ac4a7f9b133e09fe8b Mon Sep 17 00:00:00 2001 From: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Date: Mon, 14 Nov 2022 11:35:02 +0100 Subject: [PATCH] [docs] Allows to access the next MUI-X (#34798) Signed-off-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Co-authored-by: Lukas --- docs/src/modules/components/AppNavDrawer.js | 50 +++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/docs/src/modules/components/AppNavDrawer.js b/docs/src/modules/components/AppNavDrawer.js index 37a3f7857ae5f6..9b5c301ac037f5 100644 --- a/docs/src/modules/components/AppNavDrawer.js +++ b/docs/src/modules/components/AppNavDrawer.js @@ -300,6 +300,8 @@ export default function AppNavDrawer(props) { if (!versions?.length) { return null; } + + const currentVersion = versions.find((version) => version.current) || versions[0]; return ( @@ -464,7 +487,28 @@ export default function AppNavDrawer(props) { metadata="MUI X" versionSelector={renderVersionSelector([ // DATE_PICKERS_VERSION is set from the X repo - { text: `v${process.env.DATE_PICKERS_VERSION}`, current: true }, + { + ...(process.env.DATE_PICKERS_VERSION.startsWith('6') + ? { + text: `v${process.env.DATE_PICKERS_VERSION}`, + current: true, + } + : { + text: `v6-alpha`, + href: `https://next.mui.com${languagePrefix}/components/data-grid/`, + }), + }, + { + ...(process.env.DATE_PICKERS_VERSION.startsWith('5') + ? { + text: `v${process.env.DATE_PICKERS_VERSION}`, + current: true, + } + : { + text: `v5`, + href: `https://mui.com${languagePrefix}/components/data-grid/`, + }), + }, ])} /> )}