-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
119 lines (103 loc) · 3.09 KB
/
index.js
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import React from 'react';
import styles from '@site/src/pages/publications.module.css';
const { v4: uuidv4 } = require('uuid');
export function ConferenceItem({conference}) {
return (
<div className={styles.conference}>{conference}</div>
);
}
export function PaperTitle({paperLink, title}) {
if (paperLink) {
return (
<h3>
<a href={paperLink} target="_blank" rel="noopener noreferrer">{title}</a>
</h3>
);
}
return (
<h3>
<a>{title}</a>
</h3>
);
}
export function AuthorItem(props) {
let authorParagraph = (
<p className={styles.authors}>
{props.authors.map((author, i) => {
let isFinal = (i == props.authors.length - 1 && props.authors.length > 1) ? "and " : ""
if (i < props.numFirstAuthor){
if (props.isBrainTeam[i]){
return (
<>{isFinal}<b>{author}<sup>*</sup></b></>
);
}
return (
<>{isFinal}{author}<sup>*</sup></>
);
}
if (props.isBrainTeam[i]){
return (
<>{isFinal}<b>{author}</b></>
);
}
return (
<>{isFinal}{author}</>
);
}).reduce((prev, curr) => props.authors.length > 2 ? [prev, ', ', curr] : [prev, " ", curr])}
</p>
);
return authorParagraph;
}
export function PaperDescription({preview, description}) {
const randomId = uuidv4();
return (
<div>
<input type="checkbox" className={styles.expanded} id={randomId} />
<p className={styles.description}>
{preview}
<span className={styles.full}>
{description}
</span>
</p>
<label for={randomId} className={styles.trigger}></label>
</div>
);
}
export function GithubItem({link, customName="Github"}) {
return (
<p className={styles.github}>
<a href={link} target="_blank" rel="noopener noreferrer">{customName}</a>
</p>
);
}
export function DemoItem({link, customName="Demo"}) {
return (
<p className={styles.demo}>
<a href={link} target="_blank" rel="noopener noreferrer">{customName}</a>
</p>
);
}
export function MiscItem({link, customName="Misc"}) {
return (
<p className={styles.misc}>
<a href={link} target="_blank" rel="noopener noreferrer">{customName}</a>
</p>
);
}
export function LeaderboardItem({link, customName="Leaderboard"}) {
return (
<p className={styles.leaderboard}>
<a href={link} target="_blank" rel="noopener noreferrer">{customName}</a>
</p>
);
}
export default {
ConferenceItem: ConferenceItem,
PaperTitle: PaperTitle,
AuthorItem: AuthorItem,
PaperDescription: PaperDescription,
GithubItem: GithubItem,
DemoItem: DemoItem,
MiscItem: MiscItem,
LeaderboardItem: LeaderboardItem,
}