Skip to content

Commit

Permalink
DOP-3514: Indicator for writer staging in header (#768)
Browse files Browse the repository at this point in the history
Created simple text indicator for writer staging in header, made mobile responsive, removed unnecessary prop
  • Loading branch information
mmeigs authored Feb 10, 2023
1 parent 6b24c85 commit f6efa7f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 19 additions & 3 deletions src/components/Header/preview-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { SidenavMobileMenuDropdown } from '../Sidenav';
import SiteBanner from '../Banner/SiteBanner';
import { theme } from '../../theme/docsTheme';

const StyledHeaderContainer = styled.header`
grid-area: header;
Expand All @@ -13,17 +14,33 @@ const StyledHeaderContainer = styled.header`

const StyledUnifiedNavPlaceholder = styled.nav`
width: 100%;
height: 88px;
height: ${theme.header.navbarHeight};
display: flex;
align-items: center;
border-bottom: 1px solid #b8c4c2;
background-color: white;
@media ${theme.screenSize.upToLarge} {
height: ${theme.header.navbarMobileHeight};
}
`;

const StyledStagingWarning = styled.p`
margin: 0 20px;
@media ${theme.screenSize.upToLarge} {
font-size: ${theme.fontSize.small};
}
`;

const Header = ({ sidenav }) => {
return (
<StyledHeaderContainer>
<SiteBanner />
<>
<StyledUnifiedNavPlaceholder />
<StyledUnifiedNavPlaceholder>
<StyledStagingWarning>This is a staging build.</StyledStagingWarning>
</StyledUnifiedNavPlaceholder>
{sidenav && <SidenavMobileMenuDropdown />}
</>
</StyledHeaderContainer>
Expand All @@ -32,7 +49,6 @@ const Header = ({ sidenav }) => {

Header.propTypes = {
sidenav: PropTypes.bool,
eol: PropTypes.bool.isRequired,
};

export default Header;
2 changes: 1 addition & 1 deletion src/layouts/preview-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const DefaultLayout = ({
isAssociatedProduct={isAssociatedProduct}
>
<GlobalGrid>
<PreviewHeader sidenav={sidenav} eol={eol} />
<PreviewHeader sidenav={sidenav} />
{sidenav && (
<Sidenav
chapters={chapters}
Expand Down

0 comments on commit f6efa7f

Please sign in to comment.