forked from QuantStack/quantstack.github.io
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSmallPortraitCard.tsx
More file actions
42 lines (39 loc) · 1.16 KB
/
SmallPortraitCard.tsx
File metadata and controls
42 lines (39 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import styles from "./styles.module.css";
import { useHistory } from "@docusaurus/router";
import Avatar from "./Avatar";
export function SmallPortraitCard({ person }) {
const history = useHistory();
function openDialog() {
const completeName = person.completeName.replace(/\s+/g, '');
const completeNameWithoutAccents = completeName
.normalize("NFD")
.replace(/[\u0300-\u036f]/g, '');
history.push({
pathname: `/about/${completeNameWithoutAccents}`,
state: { fromAbout: true, scrollY: window.scrollY, },
});
}
return (
<div onClick={openDialog}>
<div className={"card" + " " + styles.small_portrait_card}>
<div className="card__header">
<Avatar person={person} />
<div
className={
"flex-full-centered" + " " + styles.small_card_complete_name
}
>
{person.completeName}
</div>
</div>
<div className="card__body">
<div
className={"flex-full-centered" + " " + styles.small_card_position}
>
{person.position}
</div>
</div>
</div>
</div>
);
}