Skip to content

Commit 8cf196c

Browse files
Fix issues related to last names like for those having special characters.
Add logics to not scroll systematically to the top of the page when changing from about page to portrait ones and reciprocally.
1 parent eca331e commit 8cf196c

File tree

97 files changed

+101
-2458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+101
-2458
lines changed

src/components/about/LargePortraitCardPage.tsx

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import Layout from '@theme/Layout';
3-
import { useHistory, useLocation} from '@docusaurus/router';
3+
import { useHistory, useLocation } from '@docusaurus/router';
4+
import { useEffect } from 'react';
45
import { Route } from 'react-router-dom';
56
import { About } from '@site/src/components/about'
67
import LargePortraitCard from '@site/src/components/about/LargePortraitCard';
@@ -11,9 +12,32 @@ export default function LargePortraitCardPage() {
1112
const location = useLocation();
1213
const history = useHistory();
1314

14-
function handleClose() {
15+
useEffect(() => {
1516
if (location.state?.fromAbout) {
16-
history.push('/about');
17+
window.scrollTo({ top: location.state.scrollY ?? 0, behavior: 'auto' });
18+
}
19+
}, []);
20+
21+
const handleOverlayClick = () => {
22+
const scrollY = location.state?.scrollY;
23+
setTimeout(() => {
24+
if (scrollY !== undefined) {
25+
window.scrollTo({ top: scrollY, behavior: 'auto' });
26+
}
27+
}, 0);
28+
history.replace('/about');
29+
};
30+
31+
const handleClose = () => {
32+
const scrollY = location.state?.scrollY;
33+
if (location.state?.fromAbout) {
34+
history.replace('/about');
35+
36+
setTimeout(() => {
37+
if (scrollY !== undefined) {
38+
window.scrollTo({ top: scrollY, behavior: 'auto' });
39+
}
40+
}, 0);
1741
} else {
1842
history.goBack();
1943
}
@@ -24,13 +48,13 @@ export default function LargePortraitCardPage() {
2448
<Route
2549
path="/about/:completeName"
2650
render={({ history, match }) => {
27-
const { completeName } = match.params;
51+
const { completeName } = match.params; /* extract the dynamic part from the url i.e. the completeName*/
2852
const teamMembers = getTeamByPersonName(completeName);
29-
const person = teamMembers.find(person => person.completeName.replace(/\s+/g, '') === completeName);
53+
const person = teamMembers.find((person) => person.completeName.replace(/\s+/g, '').normalize("NFD").replace(/[\u0300-\u036f]/g, '') === completeName);
3054
if (!person) return null;
3155

3256
return (
33-
<div className={styles.modal_overlay} onClick={() => history.push('/about')}>
57+
<div className={styles.modal_overlay} onClick={handleOverlayClick}>
3458
<div
3559
className={styles.modal_content}
3660
onClick={(e) => e.stopPropagation()}

src/components/about/SmallPortraitCard.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ import styles from "./styles.module.css";
22
import { useHistory } from "@docusaurus/router";
33
import Avatar from "./Avatar";
44

5-
export function SmallPortraitCard({ person}) {
5+
export function SmallPortraitCard({ person }) {
66
const history = useHistory();
77

88
function openDialog() {
9+
const completeName = person.completeName.replace(/\s+/g, '');
10+
const completeNameWithoutAccents = completeName
11+
.normalize("NFD")
12+
.replace(/[\u0300-\u036f]/g, '');
913
history.push({
10-
pathname: `/about/${person.completeName.replace(/\s+/g, '')}`,
11-
state: { fromAbout: true },
14+
pathname: `/about/${completeNameWithoutAccents}`,
15+
state: { fromAbout: true, scrollY: window.scrollY, },
1216
});
1317
}
1418

src/components/about/Team/team.ts

Lines changed: 63 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ import TrungAvatarUrl from "@site/static/img/avatars/Trung.png";
6969
import YahiaMD from "@site/src/components/about/Team/Yahia.md";
7070
import YahiaAvatarUrl from "@site/static/img/avatars/Yahia.png";
7171

72-
7372
export const teams = {
7473
coreTeam: [
7574
{
@@ -328,22 +327,6 @@ export const teams = {
328327
subTeamName: "coreTeam",
329328
BioComponent: ArjunMD,
330329
},
331-
{
332-
completeName: "Antoine Pitrou",
333-
firstName: "AntoinePi",
334-
position: " Senior Software Developer",
335-
GitHubLink: "https://github.com/pitrou",
336-
LinkedInLink:
337-
"https://www.linkedin.com/in/pitrou/",
338-
BlueskyLink: "https://bsky.app/profile/pitrou.bsky.social",
339-
MastodonLink: "",
340-
GitHubName: "@pitrou",
341-
avatarUrl: AntoineAvatarUrl,
342-
distinctionTitle: ["Python Software Foundation Fellow"],
343-
distinctionLink: ["https://www.python.org/psf/fellows-roster/"],
344-
subTeamName: "coreTeam",
345-
BioComponent: AntoineMD,
346-
},
347330
{
348331
completeName: "Sandrine Pataut",
349332
firstName: "Sandrine",
@@ -378,7 +361,7 @@ export const teams = {
378361
},
379362
{
380363
completeName: "Antoine Prouvost",
381-
firstName: "AntoinePrv",
364+
firstName: "Antoine",
382365
position: " Scientific Software Developer",
383366
GitHubLink: "https://github.com/AntoinePrv",
384367
LinkedInLink: "https://www.linkedin.com/in/antoine-prouvost-0667b6a4/",
@@ -419,8 +402,38 @@ export const teams = {
419402
subTeamName: "coreTeam",
420403
BioComponent: OusemaMD,
421404
},
405+
{
406+
completeName: "Guy Mushiata Kibulu",
407+
firstName: "Guy",
408+
position: "Scientific Software Development Intern",
409+
GitHubLink: "https://github.com/Gauss-Taylor-Euler",
410+
LinkedInLink:
411+
"https://www.linkedin.com/in/guy-mushiata-kibulu-189646336/",
412+
GitHubName: "@Gauss-Taylor-Euler",
413+
avatarUrl: GuyAvatarUrl,
414+
distinctionTitle: [],
415+
distinctionLink: [],
416+
subTeamName: "coreTeam",
417+
BioComponent: GuyMD,
418+
}
422419
],
420+
423421
QSCollaboratorsTeam: [
422+
{
423+
completeName: "Johan Mabille",
424+
firstName: "Johan",
425+
position: "Technical Director",
426+
GitHubLink: "https://github.com/JohanMabille",
427+
LinkedInLink: "https://www.linkedin.com/in/johan-mabille/",
428+
BlueskyLink: "",
429+
MastodonLink: "",
430+
GitHubName: "@JohanMabille",
431+
avatarUrl: JohanAvatarUrl,
432+
distinctionTitle: ["Jupyter Distinguished Contributor"],
433+
distinctionLink: ["https://jupyter.org/about#distinguished-contributors"],
434+
subTeamName: "QSCollaboratorsTeam",
435+
BioComponent: JohanMD,
436+
},
424437
{
425438
completeName: "Serge Guelton",
426439
firstName: "Serge",
@@ -451,6 +464,37 @@ export const teams = {
451464
subTeamName: "QSCollaboratorsTeam",
452465
BioComponent: RomainMD
453466
},
467+
{
468+
completeName: "Antoine Pitrou",
469+
firstName: "Antoine",
470+
position: "Senior Software Developer",
471+
GitHubLink: "https://github.com/pitrou",
472+
LinkedInLink:
473+
"https://www.linkedin.com/in/pitrou/",
474+
BlueskyLink: "https://bsky.app/profile/pitrou.bsky.social",
475+
MastodonLink: "",
476+
GitHubName: "@pitrou",
477+
avatarUrl: AntoineAvatarUrl,
478+
distinctionTitle: ["Python Software Foundation Fellow"],
479+
distinctionLink: ["https://www.python.org/psf/fellows-roster/"],
480+
subTeamName: "QSCollaboratorsTeam",
481+
BioComponent: AntoineMD,
482+
},
483+
{
484+
completeName: "Marion Chaffaut",
485+
firstName: "Marion",
486+
position: "Chief Financial Officer",
487+
GitHubLink: "https://github.com/MarionChaff",
488+
LinkedInLink: "https://www.linkedin.com/in/marion-chaffaut/",
489+
BlueskyLink: "",
490+
MastodonLink: "",
491+
GitHubName: "@MarionChaff",
492+
avatarUrl: MarionAvatarUrl,
493+
distinctionTitle: [],
494+
distinctionLink: [],
495+
subTeamName: "QSCollaboratorsTeam",
496+
BioComponent: MarionMD,
497+
},
454498
],
455499

456500
leadershipTeam: [
@@ -469,25 +513,10 @@ export const teams = {
469513
subTeamName: "LeadershipTeam",
470514
BioComponent: SylvainMD,
471515
},
472-
{
473-
completeName: "Johan Mabille",
474-
firstName: "Johan",
475-
position: "Project Director",
476-
GitHubLink: "https://github.com/JohanMabille",
477-
LinkedInLink: "https://www.linkedin.com/in/johan-mabille/",
478-
BlueskyLink: "",
479-
MastodonLink: "",
480-
GitHubName: "@JohanMabille",
481-
avatarUrl: JohanAvatarUrl,
482-
distinctionTitle: ["Jupyter Distinguished Contributor"],
483-
distinctionLink: ["https://jupyter.org/about#distinguished-contributors"],
484-
subTeamName: "LeadershipTeam",
485-
BioComponent: JohanMD,
486-
},
487516
{
488517
completeName: "Martin Renou",
489518
firstName: "Martin",
490-
position: "Project Director",
519+
position: "Technical Director",
491520
GitHubLink: "https://github.com/martinRenou",
492521
LinkedInLink: "https://www.linkedin.com/in/martin-renou",
493522
BlueskyLink: "https://bsky.app/profile/martinrenou.bsky.social",
@@ -514,7 +543,6 @@ export const teams = {
514543
subTeamName: "LeadershipTeam",
515544
BioComponent: JeremyMD,
516545
},
517-
518546
{
519547
completeName: "Afshin Darian",
520548
firstName: "Darian",
@@ -575,20 +603,5 @@ export const teams = {
575603
subTeamName: "LeadershipTeam",
576604
BioComponent: TrungMD,
577605
},
578-
{
579-
completeName: "Marion Chaffaut",
580-
firstName: "Marion",
581-
position: "Chief Financial Officer",
582-
GitHubLink: "https://github.com/MarionChaff",
583-
LinkedInLink: "https://www.linkedin.com/in/marion-chaffaut/",
584-
BlueskyLink: "",
585-
MastodonLink: "",
586-
GitHubName: "@MarionChaff",
587-
avatarUrl: MarionAvatarUrl,
588-
distinctionTitle: [],
589-
distinctionLink: [],
590-
subTeamName: "LeadershipTeam",
591-
BioComponent: MarionMD,
592-
},
593606
]
594607
}

src/components/about/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import LinkToContact from "../home/LinkToContact";
66

77
export function getTeamByPersonName(name: string) {
88
for (const [teamName, members] of Object.entries(teams)) {
9-
const person = members.find((person) => person.completeName.replace(/\s+/g, '') === name);
9+
const person = members.find((person) => person.completeName.replace(/\s+/g, '').replace(/\s+/g, '').normalize("NFD").replace(/[\u0300-\u036f]/g, '') === name);
1010
if (person) {
1111
return members;
1212
}
File renamed without changes.

src/pages/about/Meriem.Benismail.tsx renamed to src/pages/about/MeriemBenIsmail.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import React from 'react';
2-
import Layout from '@theme/Layout';
3-
import { useHistory, useLocation} from '@docusaurus/router';
41
import LargePortraitCardPage from "@site/src/components/about/LargePortraitCardPage";
52

63
export default function AboutPage() {

static/img/quantstack/Use a dialog to display the LargePortraitCard. by HaudinFlorence · Pull Request #169 · QuantStack_quantstack.github.io_files/app_assets_modules_github_behaviors_ajax-error_ts-app_assets_modules_github_behaviors_include-d0d0a6-aa0f176b5b12.js

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)