Skip to content

Commit 5b44a67

Browse files
committed
Merge branch 'staging'
2 parents e673d00 + b133ab5 commit 5b44a67

File tree

21 files changed

+2068
-1644
lines changed

21 files changed

+2068
-1644
lines changed

client/src/api/authors/[id]/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { processYearAggregations } from "../../utils/years";
88
import { AUTHOR_SOURCE, PUBLICATION_LIGHT_SOURCE } from "../_utils/constants";
99
import { getCoAuthors, getReviewsBySource, getWikiDomains } from "../_utils/transformers";
1010

11+
12+
1113
async function getAuthorsPublicationsById(
1214
id: string,
1315
): Promise<AuthorsPublications> {
Lines changed: 92 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,118 @@
1-
import React from "react";
21
import { Container, Link } from "@dataesr/dsfr-plus";
2+
import React from "react";
33
import { IntlProvider } from "react-intl";
44

55
const modules = import.meta.glob("./locales/*.json", {
6-
eager: true,
7-
import: "default",
6+
eager: true,
7+
import: "default",
88
});
99
const messages = Object.keys(modules).reduce((acc, key) => {
10-
const locale = key.match(/\.\/locales\/(.+)\.json$/)?.[1];
11-
if (locale) {
12-
return { ...acc, [locale]: modules[key] };
13-
}
14-
return acc;
10+
const locale = key.match(/\.\/locales\/(.+)\.json$/)?.[1];
11+
if (locale) {
12+
return { ...acc, [locale]: modules[key] };
13+
}
14+
return acc;
1515
}, {});
1616

1717
export function FooterTop({ children }: { children?: React.ReactNode }) {
18-
return <div className="fr-footer__top">{children}</div>;
18+
return <div className="fr-footer__top">{children}</div>;
1919
}
2020

2121
export function Footer({
22-
children,
23-
fluid = false,
22+
children,
23+
fluid = false,
2424
}: {
25-
children?: React.ReactNode;
26-
fluid?: boolean;
25+
children?: React.ReactNode;
26+
fluid?: boolean;
2727
}) {
28-
return (
29-
<IntlProvider messages={messages} locale="fr" defaultLocale="fr">
30-
<footer className="fr-footer fr-mt-3w" role="contentinfo" id="footer">
31-
<Container fluid={fluid}>{children}</Container>
32-
</footer>
33-
</IntlProvider>
34-
);
28+
return (
29+
<IntlProvider messages={messages} locale="fr" defaultLocale="fr">
30+
<footer className="fr-footer fr-mt-3w" role="contentinfo" id="footer">
31+
<Container fluid={fluid}>{children}</Container>
32+
</footer>
33+
</IntlProvider>
34+
);
3535
}
3636

3737
export function FooterBottom({
38-
children,
39-
copy,
38+
children,
39+
copy,
4040
}: {
41-
children?: React.ReactNode;
42-
copy?: React.ReactNode;
41+
children?: React.ReactNode;
42+
copy?: React.ReactNode;
4343
}) {
44-
const childs = React.Children.toArray(children);
45-
return (
46-
<div className="fr-container fr-footer__bottom">
47-
<ul className="fr-footer__bottom-list">
48-
{childs.map((child, i) => (
49-
<li key={i} className="fr-footer__bottom-item">
50-
{child}
51-
</li>
52-
))}
53-
</ul>
54-
{copy ? (
55-
<div className="fr-footer__bottom-copy">
56-
<p>{copy}</p>
57-
</div>
58-
) : null}
59-
</div>
60-
);
44+
const childs = React.Children.toArray(children);
45+
return (
46+
<div className="fr-container fr-footer__bottom">
47+
<ul className="fr-footer__bottom-list">
48+
{childs.map((child, i) => (
49+
<li key={i} className="fr-footer__bottom-item">
50+
{child}
51+
</li>
52+
))}
53+
</ul>
54+
{copy ? (
55+
<div className="fr-footer__bottom-copy">
56+
<p>{copy}</p>
57+
</div>
58+
) : null}
59+
</div>
60+
);
6161
}
6262

6363
export function FooterBody({
64-
children,
65-
description,
64+
children,
65+
description,
6666
}: {
67-
children?: React.ReactNode;
68-
description?: React.ReactNode;
67+
children?: React.ReactNode;
68+
description?: React.ReactNode;
6969
}) {
70-
const links = React.Children.toArray(children).filter(
71-
(child) => React.isValidElement(child) && child.type === Link
72-
);
70+
const links = React.Children.toArray(children).filter(
71+
(child) => React.isValidElement(child) && child.type === Link,
72+
);
7373

74-
return (
75-
<div className="fr-container fr-footer__body">
76-
<div className="fr-footer__brand fr-enlarge-link">
77-
<p className="fr-logo">
78-
Ministère
79-
<br />
80-
chargé
81-
<br />
82-
de l'enseignement
83-
<br />
84-
supérieur
85-
<br />
86-
et de la recherche
87-
</p>
88-
<a title="Retour à l'accueil du site" href="/" className="fr-footer__brand-link">
89-
<svg
90-
aria-hidden="true"
91-
viewBox="0 0 1167.77 752.85"
92-
width="100%"
93-
>
94-
<use
95-
className="fr-text-black-white--grey"
96-
href="/logos/sies_logo_signature.svg#sies-logo-text"
97-
/>
98-
<use
99-
href="/logos/sies_logo_signature.svg#sies-logo-artwork"
100-
/>
101-
</svg>
102-
</a>
103-
</div>
104-
<div className="fr-footer__content">
105-
{description ? (
106-
<p className="fr-footer__content-desc">{description}</p>
107-
) : null}
108-
{links.length ? (
109-
<ul className="fr-footer__content-list">
110-
{links.map((link, i) => (
111-
<li key={i} className="fr-footer__content-item">
112-
{link}
113-
</li>
114-
))}
115-
</ul>
116-
) : null}
117-
</div>
118-
</div>
119-
);
74+
return (
75+
<div className="fr-container fr-footer__body">
76+
<div className="fr-footer__brand fr-enlarge-link">
77+
<p className="fr-logo">
78+
Ministère
79+
<br />
80+
de l'enseignement
81+
<br />
82+
supérieur,
83+
<br />
84+
de la recherche
85+
<br />
86+
et de l'espace
87+
</p>
88+
<a
89+
title="Retour à l'accueil du site"
90+
href="/"
91+
className="fr-footer__brand-link"
92+
>
93+
<svg aria-hidden="true" viewBox="0 0 1167.77 752.85" width="100%">
94+
<use
95+
className="fr-text-black-white--grey"
96+
href="/logos/sies_logo_signature.svg#sies-logo-text"
97+
/>
98+
<use href="/logos/sies_logo_signature.svg#sies-logo-artwork" />
99+
</svg>
100+
</a>
101+
</div>
102+
<div className="fr-footer__content">
103+
{description ? (
104+
<p className="fr-footer__content-desc">{description}</p>
105+
) : null}
106+
{links.length ? (
107+
<ul className="fr-footer__content-list">
108+
{links.map((link, i) => (
109+
<li key={i} className="fr-footer__content-item">
110+
{link}
111+
</li>
112+
))}
113+
</ul>
114+
) : null}
115+
</div>
116+
</div>
117+
);
120118
}
Lines changed: 75 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,84 @@
1-
import cs from 'classnames';
21
import { Accordion, Col, Row, Text, Title } from "@dataesr/dsfr-plus";
2+
import cs from "classnames";
33
import useScreenSize from "../../hooks/useScreenSize";
4-
import './styles.scss';
4+
import "./styles.scss";
55

66
type PageSectionProps = {
7-
children: React.ReactNode,
8-
title: string,
9-
description?: React.ReactNode,
10-
action?: React.ReactNode,
11-
show: boolean,
12-
icon?: string,
13-
size?: "hero" | "lead" | "lg" | "md" | "sm" | "xs"
14-
}
7+
children?: React.ReactNode;
8+
title?: string;
9+
description?: React.ReactNode;
10+
action?: React.ReactNode;
11+
show: boolean;
12+
icon?: string;
13+
size?: "hero" | "lead" | "lg" | "md" | "sm" | "xs";
14+
};
1515

16-
export function PageSection({ children, title, icon, action, description = "", show = false, size = "md" }: PageSectionProps) {
17-
const { screen } = useScreenSize();
18-
if (!show) {
19-
return null;
20-
}
21-
const titleCSS = cs("page-section__title", {
22-
[`fr-text--${size}`]: size !== "hero",
23-
"fr-h5": size === "hero",
24-
[`fr-icon-${icon}`]: icon,
25-
"fr-mb-1v": description,
26-
"fr-mb-0": !description,
27-
});
28-
const TitlePart = () => (
29-
<div style={{ display: 'flex', alignContent: "flex-start", alignItems: "flex-start" }}>
30-
<div style={{ flexGrow: 1 }}>
31-
<Title as="h2" className={titleCSS}>
32-
{title}
33-
</Title>
34-
{description && (<Text className="fr-card__detail" size="xs">
35-
{description}
36-
</Text>)}
37-
</div>
38-
{action && (
39-
<div>
40-
{action}
41-
</div>
42-
)}
43-
</div>
44-
)
45-
if (["xs", "sm"].includes(screen)) {
46-
return (
47-
<Accordion title={title}>
48-
{children}
49-
</Accordion>
50-
);
51-
}
52-
return (
53-
<Col xs="12">
54-
<section>
55-
<TitlePart />
56-
<div className="fr-py-3w">
57-
{children}
58-
</div>
59-
</section>
60-
</Col>
61-
);
16+
export function PageSection({
17+
children,
18+
title,
19+
icon,
20+
action,
21+
description = "",
22+
show = false,
23+
size = "md",
24+
}: PageSectionProps) {
25+
const { screen } = useScreenSize();
26+
if (!show) {
27+
return null;
28+
}
29+
const titleCSS = cs("page-section__title", {
30+
[`fr-text--${size}`]: size !== "hero",
31+
"fr-h5": size === "hero",
32+
[`fr-icon-${icon}`]: icon,
33+
"fr-mb-1v": description,
34+
"fr-mb-0": !description,
35+
});
36+
const TitlePart = () => (
37+
<div
38+
style={{
39+
display: "flex",
40+
alignContent: "flex-start",
41+
alignItems: "flex-start",
42+
}}
43+
>
44+
<div style={{ flexGrow: 1 }}>
45+
<Title as="h2" className={titleCSS}>
46+
{title}
47+
</Title>
48+
{description && (
49+
<Text className="fr-card__detail" size="xs">
50+
{description}
51+
</Text>
52+
)}
53+
</div>
54+
{action && <div>{action}</div>}
55+
</div>
56+
);
57+
if (["xs", "sm"].includes(screen)) {
58+
return <Accordion title={title}>{children}</Accordion>;
59+
}
60+
return (
61+
<Col xs="12">
62+
<section>
63+
{title && <TitlePart />}
64+
<div className={title &&"fr-py-3w"}>{children}</div>
65+
</section>
66+
</Col>
67+
);
6268
}
6369

6470
export function PageContent({ children }: { children: React.ReactNode }) {
65-
const { screen } = useScreenSize();
71+
const { screen } = useScreenSize();
6672

67-
return (
68-
<Col xs="12">
69-
<Row gutters={!["xs", "sm"].includes(screen)}>
70-
{
71-
["xs", "sm"].includes(screen)
72-
? <ul className="fr-accordions-group">{children}</ul>
73-
: children
74-
}
75-
</Row>
76-
</Col>
77-
);
78-
}
73+
return (
74+
<Col xs="12">
75+
<Row gutters={!["xs", "sm"].includes(screen)}>
76+
{["xs", "sm"].includes(screen) ? (
77+
<ul className="fr-accordions-group">{children}</ul>
78+
) : (
79+
children
80+
)}
81+
</Row>
82+
</Col>
83+
);
84+
}

client/src/layout/components/header/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default function Header() {
6363
<HeaderWrapper>
6464
<Logo
6565
splitCharacter="|"
66-
text="Ministère|chargé|de l'enseignement|supérieur|et de la recherche"
66+
text="Ministère|de l'enseignement|supérieur,|de la recherche|et de l'espace"
6767
/>
6868
<Service
6969
name="scanR"

0 commit comments

Comments
 (0)