diff --git a/frontend/src/component/admin/menu/AdminMenu.tsx b/frontend/src/component/admin/menu/AdminMenu.tsx index 2d684fe71b..2498596767 100644 --- a/frontend/src/component/admin/menu/AdminMenu.tsx +++ b/frontend/src/component/admin/menu/AdminMenu.tsx @@ -1,28 +1,30 @@ import React from 'react'; import { NavLink, useLocation } from 'react-router-dom'; -import { Paper, Tab, Tabs } from '@mui/material'; +import { Paper, Tab, Tabs, Theme } from '@mui/material'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { useInstanceStatus } from 'hooks/api/getters/useInstanceStatus/useInstanceStatus'; - -const navLinkStyle = { - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - width: '100%', - textDecoration: 'none', - color: 'inherit', - padding: '0.8rem 1.5rem', -}; - -const activeNavLinkStyle: React.CSSProperties = { - fontWeight: 'bold', - borderRadius: '3px', - padding: '0.8rem 1.5rem', -}; +import { useTheme } from '@mui/material/styles'; const createNavLinkStyle = (props: { isActive: boolean; + theme: Theme; }): React.CSSProperties => { + const navLinkStyle = { + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + width: '100%', + textDecoration: 'none', + color: 'inherit', + padding: props.theme.spacing(1.5, 3), + }; + + const activeNavLinkStyle: React.CSSProperties = { + fontWeight: 'bold', + borderRadius: '3px', + padding: props.theme.spacing(1.5, 3), + }; + return props.isActive ? { ...navLinkStyle, ...activeNavLinkStyle } : navLinkStyle; @@ -30,6 +32,7 @@ const createNavLinkStyle = (props: { function AdminMenu() { const { uiConfig } = useUiConfig(); + const theme = useTheme(); const { pathname } = useLocation(); const { isBilling } = useInstanceStatus(); const { flags } = uiConfig; @@ -42,11 +45,21 @@ function AdminMenu() { boxShadow: 'none', }} > - + + + createNavLinkStyle({ isActive, theme }) + } + > Users } @@ -57,7 +70,9 @@ function AdminMenu() { label={ + createNavLinkStyle({ isActive, theme }) + } > Groups @@ -70,7 +85,9 @@ function AdminMenu() { label={ + createNavLinkStyle({ isActive, theme }) + } > Project roles @@ -80,7 +97,12 @@ function AdminMenu() { + + createNavLinkStyle({ isActive, theme }) + } + > API access } @@ -91,7 +113,9 @@ function AdminMenu() { label={ + createNavLinkStyle({ isActive, theme }) + } > CORS origins @@ -101,7 +125,12 @@ function AdminMenu() { + + createNavLinkStyle({ isActive, theme }) + } + > Single sign-on } @@ -112,7 +141,9 @@ function AdminMenu() { label={ + createNavLinkStyle({ isActive, theme }) + } > Billing diff --git a/frontend/src/component/common/TabNav/TabNav/TabNav.tsx b/frontend/src/component/common/TabNav/TabNav/TabNav.tsx index b3c1122456..c8f3804ed1 100644 --- a/frontend/src/component/common/TabNav/TabNav/TabNav.tsx +++ b/frontend/src/component/common/TabNav/TabNav/TabNav.tsx @@ -15,7 +15,6 @@ interface ITabData { label: string; component: ReactNode; } - export const TabNav = ({ tabData, className = '', @@ -24,7 +23,6 @@ export const TabNav = ({ }: ITabNavProps) => { const { classes: styles } = useStyles(); const [activeTab, setActiveTab] = useState(startingTab); - const renderTabs = () => tabData.map((tab, index) => ( ({ '& .MuiTabs-indicator': { height: '4px', }, - }, + '& .MuiTabs-flexContainer': { + minHeight: '70px', + maxHeight: '70px', + }, + }), }, }, MuiTab: { styleOverrides: { - root: { + root: ({ theme }) => ({ color: colors.grey[900], fontSize: '1rem', textTransform: 'none', fontWeight: 400, + lineHeight: '1', minHeight: '62px', '&:hover': { backgroundColor: colors.grey[200], @@ -287,7 +292,10 @@ export default createTheme({ '& > span': { color: colors.purple[900], }, - }, + [theme.breakpoints.down('md')]: { + padding: '12px 0px', + }, + }), }, }, MuiAccordion: {