Skip to content

Commit 76faa10

Browse files
Update SmallPortraitCard and SmallPortraitCardWithDialog. Add the pages for the collaborators.
1 parent 5b58c1b commit 76faa10

File tree

6 files changed

+37
-23
lines changed

6 files changed

+37
-23
lines changed

src/components/about/SmallPortraitCard.tsx

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import styles from "./styles.module.css";
2-
import { useHistory } from "react-router";
2+
import { useHistory } from "@docusaurus/router";
33
import Avatar from "./Avatar";
4-
import { useState } from "react";
5-
import Link from "@docusaurus/Link";
64

75
export function SmallPortraitCard({ person }) {
8-
let [isDialogOpen, setIsDialogOpen] = useState(false);
9-
106
const history = useHistory();
117

12-
const openDialog = () => {
8+
function openDialog () {
9+
history.push("/about/");
10+
console.log('history:', history.location)
1311
history.push("/about/" + person.firstName);
14-
setIsDialogOpen(true);
12+
console.log('history:', history.location)
1513
};
1614

1715
return (

src/components/about/SmallPortraitCardWithDialog.tsx

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
import styles from "./styles.module.css";
22
import React from "react";
3-
import {
4-
BrowserRouter as Router,
5-
Route,
6-
Switch,
7-
useHistory,
8-
} from "react-router-dom";
9-
import { useState } from "react";
3+
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
4+
import { useHistory } from "@docusaurus/router";
5+
106
import LargePortraitCard from "./LargePortraitCard";
117
import { SmallPortraitCard } from "./SmallPortraitCard";
128

13-
export default function SmallPortraitCardWithDialog({ person }) {
9+
export function SmallPortraitCardWithDialog({ person }) {
1410
const history = useHistory();
15-
let [isDialogOpen, setIsDialogOpen] = useState(true);
16-
const overlay = document.getElementsByClassName("modal_overlay");
17-
const closeButton = document.getElementsByClassName("close-button");
1811

1912
function closeDialog() {
20-
history.goBack();
21-
console.log("overlay clicked")
13+
history.goBack()
2214
}
2315

2416
return (

src/components/about/SubTeam.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import styles from "./styles.module.css";
2-
import SmallPortraitCardWithDialog from "./SmallPortraitCardWithDialog";
2+
import Example from "./PortraitDialog";
3+
import { SmallPortraitCardWithDialog } from "./SmallPortraitCardWithDialog";
4+
35

46
export default function SubTeam({ subTeamName, subTeam }) {
57
return (
@@ -8,7 +10,7 @@ export default function SubTeam({ subTeamName, subTeam }) {
810
<div className={"container"}>
911
<ul className="row padding-none flex-full-centered row-with-margin-top">
1012
{subTeam.map((person, index) => (
11-
<li className="cards-list" key={index}>
13+
<li className="cards-list" key={person.firstName}>
1214
<div className="col">
1315
<SmallPortraitCardWithDialog person={person} />
1416
</div>

src/components/careers/Interviews.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Interviews({ details, description }) {
88
<div className="container">
99
<ul className={"row" + " "+ "flex-full-centered"}>
1010
{details.map((person, index) => (
11-
<li className="cards-list" key={index}>
11+
<li className="cards-list" key={person.firstName}>
1212
<div className="col col--2">
1313
<InterviewCard person={person} />
1414
</div>

src/pages/about/Romain.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Layout from "@theme/Layout";
2+
import { About } from "@site/src/components/about";
3+
import BrowserOnly from "@docusaurus/BrowserOnly";
4+
5+
export default function AboutPage(): JSX.Element {
6+
return (
7+
<Layout>
8+
<BrowserOnly>{() => <About/>}</BrowserOnly>
9+
</Layout>
10+
);
11+
}

src/pages/about/Serge.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Layout from "@theme/Layout";
2+
import { About } from "@site/src/components/about";
3+
import BrowserOnly from "@docusaurus/BrowserOnly";
4+
5+
export default function AboutPage(): JSX.Element {
6+
return (
7+
<Layout>
8+
<BrowserOnly>{() => <About/>}</BrowserOnly>
9+
</Layout>
10+
);
11+
}

0 commit comments

Comments
 (0)