Skip to content

Commit

Permalink
Austenem/CAT-944 Entity header styling bugs (#3569)
Browse files Browse the repository at this point in the history
* re-center entity header content

* fix header bug

* add changelog

* Update context/app/static/js/components/detailPage/entityHeader/EntityHeaderContent/EntityHeaderContent.tsx

Co-authored-by: Nikolay Akhmetov <[email protected]>

---------

Co-authored-by: Nikolay Akhmetov <[email protected]>
  • Loading branch information
austenem and NickAkhmetov authored Oct 11, 2024
1 parent e07978c commit 90f1ea4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-entity-header-styling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix Webkit-specific bugs that caused the entity header to become misaligned.
5 changes: 3 additions & 2 deletions context/app/static/js/components/Header/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';

import Box from '@mui/material/Box';
import EntityHeader from 'js/components/detailPage/entityHeader/EntityHeader';
import HeaderAppBar from '../HeaderAppBar';
import HeaderContent from '../HeaderContent';
Expand All @@ -9,12 +10,12 @@ function Header() {
const { shouldDisplayHeader, ...props } = useEntityHeaderVisibility();

return (
<>
<Box sx={(theme) => ({ position: 'fixed', width: '100%', zIndex: theme.zIndex.header })}>
<HeaderAppBar {...props}>
<HeaderContent />
</HeaderAppBar>
{shouldDisplayHeader && <EntityHeader />}
</>
</Box>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const StyledPaper = styled(Paper)(({ theme }) => ({
position: 'sticky',
width: '100%',
top: headerHeight,
zIndex: theme.zIndex.entityHeader,
zIndex: theme.zIndex.header,
}));

export { StyledPaper };
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ function EntityHeaderContent({ view, setView }: { view: SummaryViewsType; setVie
<Stack
direction="row"
alignItems="center"
height="3rem"
px={2}
py={0.5}
sx={(theme) => ({ ...(view !== 'narrow' && { borderBottom: `1px solid ${theme.palette.primary.lowEmphasis}` }) })}
Expand Down
4 changes: 2 additions & 2 deletions context/app/static/js/theme/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ declare module '@mui/material/styles' {
export interface ZIndex {
tutorial: number;
dropdownOffset: number;
entityHeader: number;
header: number;
dropdown: number;
visualization: number;
fileBrowserHeader: number;
Expand Down Expand Up @@ -264,7 +264,7 @@ const theme = createTheme({
zIndex: {
tutorial: 1101, // one higher than AppBar zIndex provided by MUI
dropdownOffset: 1001,
entityHeader: 1000,
header: 1000,
dropdown: 50,
visualization: 3,
fileBrowserHeader: 1,
Expand Down

0 comments on commit 90f1ea4

Please sign in to comment.