generated from pythonpizza/template-website-v1
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.tsx
executable file
·84 lines (74 loc) · 2.86 KB
/
index.tsx
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
import * as React from 'react';
import Container, { Sizes } from '@/Components/Container';
import Logo from '@/Components/Logo';
import './index.css';
export default class Header extends React.Component {
onNavClick(e: React.MouseEvent<HTMLAnchorElement>) {
e.preventDefault();
const target = e.target as HTMLAnchorElement;
const destinationId = target.getAttribute('data-destination');
const destinationDom: HTMLElement | null = window.document.querySelector(`#${destinationId}`);
if (!destinationDom) {
return;
}
window.scrollTo({
top: destinationDom.offsetTop,
behavior: 'smooth',
});
}
render() {
return (
<div className="header">
<Container size={Sizes.large}>
<Logo className="header--logo" />
<ul className="header--links">
<li>
<a onClick={this.onNavClick} href="#about" data-destination="about">
About 🍕
</a>
</li>
<li>
<a onClick={this.onNavClick} href="#sponsors" data-destination="sponsors">
Sponsors
</a>
</li>
<li>
<a href="https://forms.gle/98nPd3pYZkELSzvs5" target="_blank" rel="noopener noreferrer">
Call for Proposals
</a>
</li>
<li>
<a onClick={this.onNavClick} href="#travel" data-destination="travel">
Travel Info
</a>
</li>
<li>
<a onClick={this.onNavClick} href="#coc" data-destination="coc">
CoC
</a>
</li>
<li>
<a onClick={this.onNavClick} href="#imprint" data-destination="imprint">
Imprint
</a>
</li>
<li>
<a
href="https://ti.to/pythonpizza/pypizza-sudwest"
target="_blank"
rel="noopener noreferrer"
>
Tickets
</a>
</li>
</ul>
</Container>
</div>
);
}
}
// <li>
//<a onClick={this.onNavClick} href="#schedule" data-destination="schedule">
//Schedule
//</a>
//</li>