Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Austenem/CAT-944 Entity header styling bugs #3569

Merged
merged 4 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading