Skip to content

Commit

Permalink
[docs-infra] Fix version tooltip (#15468)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette authored Nov 18, 2024
1 parent 09a70a7 commit 3d25ecc
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions docs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,13 @@ function AppWrapper(props) {
href: `${languagePrefix}${productIdSubpathMap[id]}/`,
};
}
if (version === 'v7') {
// #default-branch-switch
return {
text: version,
href: `https://mui.com${languagePrefix}${productIdSubpathMap[id]}/`,
};
}
return {
text: version,
href: `https://${version}.mui.com${languagePrefix}${productIdSubpathMap[id]}/`,
Expand All @@ -232,7 +239,7 @@ function AppWrapper(props) {
metadata: '',
name: 'MUI X',
versions: [
...getVersionOptions('introduction', ['next', process.env.LIB_VERSION, 'v6', 'v5']),
...getVersionOptions('introduction', [process.env.LIB_VERSION, 'v7', 'v6', 'v5']),
{ text: 'v4', href: `https://v4.mui.com${languagePrefix}/components/data-grid/` },
],
};
Expand All @@ -242,7 +249,7 @@ function AppWrapper(props) {
metadata: 'MUI X',
name: 'Data Grid',
versions: [
...getVersionOptions('x-data-grid', ['next', process.env.DATA_GRID_VERSION, 'v6', 'v5']),
...getVersionOptions('x-data-grid', [process.env.DATA_GRID_VERSION, 'v7', 'v6', 'v5']),
{ text: 'v4', href: `https://v4.mui.com${languagePrefix}/components/data-grid/` },
],
};
Expand All @@ -251,7 +258,7 @@ function AppWrapper(props) {
metadata: 'MUI X',
name: 'Date Pickers',
versions: [
...getVersionOptions('x-date-pickers', ['next', process.env.DATE_PICKERS_VERSION, 'v6']),
...getVersionOptions('x-date-pickers', [process.env.DATE_PICKERS_VERSION, 'v7', 'v6']),
{
text: 'v5',
href: `https://v5.mui.com${languagePrefix}/x/react-date-pickers/getting-started/`,
Expand All @@ -262,14 +269,14 @@ function AppWrapper(props) {
productIdentifier = {
metadata: 'MUI X',
name: 'Charts',
versions: getVersionOptions('x-charts', ['next', process.env.CHARTS_VERSION, 'v6']),
versions: getVersionOptions('x-charts', [process.env.CHARTS_VERSION, 'v7', 'v6']),
};
} else if (productId === 'x-tree-view') {
productIdentifier = {
metadata: 'MUI X',
name: 'Tree View',
versions: [
...getVersionOptions('x-tree-view', ['next', process.env.TREE_VIEW_VERSION]),
...getVersionOptions('x-tree-view', [process.env.TREE_VIEW_VERSION, 'v7']),
{
text: 'v6',
href: `https://v6.mui.com${languagePrefix}/x/react-tree-view/getting-started`,
Expand Down

0 comments on commit 3d25ecc

Please sign in to comment.