Skip to content

Commit 600a340

Browse files
Update the Distinction component.
1 parent 926bcb2 commit 600a340

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

src/components/about/LargePortraitCard.tsx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,28 @@ import React from "react";
66
import Avatar from "./Avatar";
77

88
export function Distinction({ person }) {
9-
if (person.distinctionTitle.length !== 0) {
10-
return person.distinctionTitle.map((distinction, index) => (
11-
<div>
12-
<Link href={person.distinctionLink[index]}>
13-
<DistinctionIcon className={styles.distinction_icon} />
14-
{distinction}
15-
</Link>
16-
</div>
17-
));
18-
} else return <div></div>;
9+
const HasPersonDisctinction = person.distinctionTitle.length !== 0;
10+
11+
return (
12+
<div>
13+
{HasPersonDisctinction ? (
14+
<ul style={{paddingLeft: "0px"}}>
15+
{person.distinctionTitle.map((distinction, index) => (
16+
<li className="items-list" key={person.firstName}>
17+
<div>
18+
<Link href={person.distinctionLink[index]}>
19+
<DistinctionIcon className={styles.distinction_icon} />
20+
{distinction}
21+
</Link>
22+
</div>
23+
</li>
24+
))}
25+
</ul>
26+
) : null}
27+
</div>
28+
);
1929
}
30+
2031
export default function LargePortraitCard({ person }) {
2132
return (
2233
<div className={styles.large_portrait_card}>

src/components/about/SmallPortraitCardWithDialog.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ import styles from "./styles.module.css";
22
import React from "react";
33
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
44
import { useHistory } from "@docusaurus/router";
5+
import { useState } from "react";
56

67
import LargePortraitCard from "./LargePortraitCard";
78
import { SmallPortraitCard } from "./SmallPortraitCard";
89

910
export function SmallPortraitCardWithDialog({ person }) {
1011
const history = useHistory();
1112

13+
1214
function closeDialog() {
13-
history.goBack()
15+
history.goBack();
1416
}
1517

1618
return (

src/css/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,3 +655,7 @@ ul.row {
655655
margin-left: 0;
656656
width: 100%;
657657
}
658+
659+
.items-list {
660+
list-style-type: none;
661+
}

0 commit comments

Comments
 (0)