-
-
Notifications
You must be signed in to change notification settings - Fork 728
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update menu for billing page (#4525)
## About the changes - [x] Show admin menu on billing page in cloud offering. Category menu was not showing up because we have 2 different pages for billing (hosted or not) - [x] Fix menu tab padding https://linear.app/unleash/issue/1-1266/update-menu-for-billing-page
- Loading branch information
Showing
8 changed files
with
35 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,21 @@ | ||
import { Theme } from '@mui/material'; | ||
import React, { FC } from 'react'; | ||
import { styled } from '@mui/material'; | ||
import { FC } from 'react'; | ||
import { NavLink } from 'react-router-dom'; | ||
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 = { | ||
const StyledNavLink = styled(NavLink)(({ theme }) => ({ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
width: '100%', | ||
height: '100%', | ||
textDecoration: 'none', | ||
color: 'inherit', | ||
padding: theme.spacing(0, 5), | ||
'&.active': { | ||
fontWeight: 'bold', | ||
borderRadius: '3px', | ||
padding: props.theme.spacing(1.5, 3), | ||
}; | ||
|
||
return props.isActive | ||
? { ...navLinkStyle, ...activeNavLinkStyle } | ||
: navLinkStyle; | ||
}; | ||
}, | ||
})); | ||
|
||
export const CenteredNavLink: FC<{ to: string }> = ({ to, children }) => { | ||
const theme = useTheme(); | ||
return ( | ||
<NavLink | ||
to={to} | ||
style={({ isActive }) => createNavLinkStyle({ isActive, theme })} | ||
> | ||
{children} | ||
</NavLink> | ||
); | ||
return <StyledNavLink to={to}>{children}</StyledNavLink>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,7 @@ export const RolesPage = () => { | |
</span> | ||
</CenteredNavLink> | ||
} | ||
sx={{ padding: 0 }} | ||
/> | ||
))} | ||
</Tabs> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters