-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
75 lines (68 loc) · 2.71 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
import * as React from 'react';
import SVGInline from 'react-svg-inline';
import './index.css';
import Container, { Sizes } from '@/Components/Container';
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}>
<SVGInline className="header--logo" svg={require('Assets/logo.svg')} />
<ul className="header--links">
<li>
<a onClick={this.onNavClick} href="#about" data-destination="about">
About 🍕
</a>
</li>
<li>
<a onClick={this.onNavClick} href="#schedule" data-destination="schedule">
Schedule
</a>
</li>
<li>
<a onClick={this.onNavClick} href="#sponsors" data-destination="sponsors">
Sponsors
</a>
</li>
<li>
<a onClick={this.onNavClick} href="#coc" data-destination="coc">
CoC
</a>
</li>
<li>
<a
href="https://forms.gle/um1jAQXWrGpM7qwg6"
target="_blank"
rel="noopener noreferrer"
>
Call for Proposals
</a>
</li>
{/* <li>
<a
href="https://ti.to/pythonpizza/berlin-python-pizza-2020"
target="_blank"
rel="noopener noreferrer"
>
Tickets
</a>
</li> */}
</ul>
</Container>
</div>
);
}
}