-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathApp.js
76 lines (70 loc) · 2.77 KB
/
App.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
import React, { Component } from 'react'
import { Routes, Route } from 'react-router'
import { ConfigProvider, Layout, Menu, Button } from 'antd'
import Highcharts from 'highcharts'
import AccessibilityModule from 'highcharts/modules/accessibility'
import enUs from 'antd/lib/locale/en_US'
import { Download, Trends } from './Graph'
import AdoptiumLogo from './Adoptiumlogo.svg'
import NavigationMenu from './Components/NavigationMenu'
import ErrorBoundary from './ErrorBoundary'
import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons'
AccessibilityModule(Highcharts)
Highcharts.AST.allowedAttributes.push('rel')
const { Header, Content, Sider } = Layout
const menuItems = [
{
key: '1',
icon: <a href='https://adoptium.net/' style={{ height: '100%', display: 'flex' }}><img alt='Adoptium Logo' src={AdoptiumLogo} style={{ height: '3.5em', paddingTop: '.5em' }} /></a>
}
]
export default class App extends Component {
state = {
collapsed: false
}
handleToggle = () => {
this.setState({
collapsed: !this.state.collapsed
})
}
render () {
return (
<ConfigProvider locale={enUs}>
<Layout>
<Header className='header' style={{ background: '#14003c' }}>
<div className='logo' />
<Menu
theme='dark'
mode='horizontal'
defaultSelectedKeys={['2']}
style={{ lineHeight: '15px', background: '#14003c' }}
items={menuItems}
/>
</Header>
<Layout>
<Sider width={200} style={{ background: '#fff' }} trigger={null} collapsible collapsed={this.state.collapsed}>
<NavigationMenu />
</Sider>
<Layout style={{ padding: '0 24px 24px' }}>
<ErrorBoundary>
<Content style={{ background: '#fff', padding: 24, margin: 0, minHeight: 280 }}>
<Button onClick={this.handleToggle} type='link' shape='circle' icon={this.state.collapsed ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />} />
<Routes>
<Route exact path='/' element={<Download />} />
<Route path='/download' element={<Download />} />
<Route path='/trends' element={<Trends />} />
</Routes>
</Content>
</ErrorBoundary>
</Layout>
</Layout>
<Layout>
<footer className='py-3 mt-auto' style={{ background: '#14003c', margin: '20px 0' }}>
<a href='https://www.netlify.com' style={{ height: '100%', display: 'flex' }}><img src='https://www.netlify.com/v3/img/components/netlify-light.svg' alt='Deploys by Netlify' /></a>
</footer>
</Layout>
</Layout>
</ConfigProvider>
)
}
}