commit | author | age
|
a0dac2
|
1 |
import React from 'react'; |
MC |
2 |
import { Brand, Page, PageHeader, PageSidebar, PageSection } from '@patternfly/react-core'; |
|
3 |
|
|
4 |
import imgBrand from './training_white.png' |
|
5 |
import NavList from './NavList' |
|
6 |
|
|
7 |
class VerticalPage extends React.Component { |
|
8 |
constructor(props) { |
|
9 |
super(props); |
|
10 |
this.state = { |
|
11 |
isNavOpen: true, |
|
12 |
}; |
|
13 |
this.onNavToggle = () => { |
|
14 |
this.setState({ |
|
15 |
isNavOpen: !this.state.isNavOpen |
|
16 |
}); |
|
17 |
}; |
|
18 |
} |
|
19 |
|
|
20 |
|
|
21 |
render() { |
|
22 |
const { isNavOpen } = this.state; |
|
23 |
|
|
24 |
const logoProps = { |
1264f7
|
25 |
href: '/frontend/' |
a0dac2
|
26 |
}; |
MC |
27 |
const Header = ( |
|
28 |
<PageHeader |
|
29 |
logo={<Brand src={imgBrand} alt="Patternfly Logo" />} |
|
30 |
logoProps={logoProps} |
|
31 |
showNavToggle |
|
32 |
isNavOpen={isNavOpen} |
|
33 |
onNavToggle={this.onNavToggle} |
|
34 |
style={{ borderTop: "2px solid #c00" }} |
|
35 |
/> |
|
36 |
); |
|
37 |
const Sidebar = <PageSidebar nav={<NavList/>} isNavOpen={isNavOpen} theme="dark" />; |
|
38 |
|
|
39 |
return ( |
|
40 |
<Page header={Header} sidebar={Sidebar} style={{minHeight: 800}}> |
|
41 |
<PageSection > |
|
42 |
{this.props.children} |
|
43 |
</PageSection> |
|
44 |
</Page> |
|
45 |
); |
|
46 |
} |
|
47 |
} |
|
48 |
|
1e067d
|
49 |
export default VerticalPage; |