make tabs horizontally scroll if <1500px

This commit is contained in:
Rares Mardare 2022-11-23 17:04:27 +02:00
parent af418573e3
commit 987700bbf4
5 changed files with 12 additions and 2 deletions

View file

@ -21,6 +21,7 @@
max-width: unset !important;
flex-grow: unset !important;
flex-basis: unset !important;
overflow-x: auto;
}
.page-scrollbar-content > div:first-child {

View file

@ -0,0 +1,3 @@
.root {
min-width: 1500px;
}

View file

@ -2,10 +2,15 @@ import React from 'react';
import { IconName } from '@grafana/data';
import { Tab, TabsBar } from '@grafana/ui';
import cn from 'classnames/bind';
import { pages } from 'pages';
import { useStore } from 'state/useStore';
import styles from './LegacyNavTabsBar.module.scss';
const cx = cn.bind(styles);
export default function LegacyNavTabsBar({ currentPage }: { currentPage: string }): JSX.Element {
const store = useStore();
@ -14,7 +19,7 @@ export default function LegacyNavTabsBar({ currentPage }: { currentPage: string
.filter((page) => (page.hideFromTabsFn ? !page.hideFromTabsFn(store) : !page.hideFromTabs));
return (
<TabsBar>
<TabsBar className={cx('root')}>
{navigationPages.map((page, index) => (
<Tab
key={index}

View file

@ -101,7 +101,7 @@ export const pages: { [id: string]: PageDefinition } = [
{
icon: 'cog',
id: 'settings',
text: 'Organization Settings',
text: 'Settings',
hideFromBreadcrumbs: true,
path: getPath('settings'),
},

View file

@ -34,6 +34,7 @@
"name": "Alert Groups",
"path": "/a/grafana-oncall-app/?page=incidents",
"role": "Viewer",
"defaultNav": true,
"addToNav": true
},
{