Skip to content

Commit

Permalink
fix(header): Display expanded header on homepage, otherwise compact v…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
annelhote committed Nov 13, 2024
1 parent d2cd33b commit 98227f8
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
64 changes: 32 additions & 32 deletions client/src/layout/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,8 @@ const {
} = import.meta.env;

// TODO : all, Link from dsfr-plus
export default function Header({ isSticky }) {
return isSticky ? (
<Container as="section" className="filters sticky" fluid>
<Row className="fr-p-1w" verticalAlign="top">
<Ribbon />
<Col offsetXs="1" xs="2">
<a
href="/"
title={`Accueil - ${VITE_MINISTER_NAME.replaceAll(
'<br>',
' ',
)}`}
>
<Title as="h1" className="fr-m-0" look="h6">
{VITE_APP_NAME}
{VITE_HEADER_TAG && (
<Badge
className="fr-ml-1w"
color={VITE_HEADER_TAG_COLOR}
size="sm"
>
{VITE_HEADER_TAG}
</Badge>
)}
</Title>
</a>
</Col>
</Row>
</Container>
) : (
export default function Header({ isExpanded }) {
return isExpanded ? (
<header role="banner" className="fr-header">
<Ribbon />
<div className="fr-header__body">
Expand Down Expand Up @@ -85,12 +57,40 @@ export default function Header({ isSticky }) {
</div>
</div>
</header>
) : (
<Container as="section" className="filters sticky" fluid>
<Row className="fr-p-1w" verticalAlign="top">
<Ribbon />
<Col offsetXs="1" xs="2">
<a
href="/"
title={`Accueil - ${VITE_MINISTER_NAME.replaceAll(
'<br>',
' ',
)}`}
>
<Title as="h1" className="fr-m-0" look="h6">
{VITE_APP_NAME}
{VITE_HEADER_TAG && (
<Badge
className="fr-ml-1w"
color={VITE_HEADER_TAG_COLOR}
size="sm"
>
{VITE_HEADER_TAG}
</Badge>
)}
</Title>
</a>
</Col>
</Row>
</Container>
);
}

Header.defaultProps = {
isSticky: false,
isExpanded: false,
};
Header.propTypes = {
isSticky: PropTypes.bool,
isExpanded: PropTypes.bool,
};
2 changes: 1 addition & 1 deletion client/src/pages/datasets/results.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function Affiliations() {

return (
<>
<Header isSticky />
<Header />
<Container as="section" className="fr-mt-4w">
{isFetching && (
<Row>
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { isInProduction } from '../utils/helpers';
export default function Home() {
return (
<>
<Header />
<Header isExpanded />
<Container as="section" className="fr-mt-4w">
<Row gutters className="fr-mb-16w">
<Col sm={12} md={4}>
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/openalex-ror/results.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export default function Affiliations() {

return (
<>
<Header isSticky />
<Header />
<Container fluid as="main" className="wm-bg">
{isFetching && (
<Container style={{ textAlign: 'center', minHeight: '600px' }} className="fr-pt-5w wm-font">
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/publications/results.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function Affiliations() {

return (
<>
<Header isSticky />
<Header />
<Container as="section" className="fr-mt-4w">
{isFetching && (
<Row>
Expand Down

0 comments on commit 98227f8

Please sign in to comment.