notification bar callback
This commit is contained in:
parent
4eb3e145e9
commit
648c7a6561
|
@ -13,6 +13,9 @@ import { Components } from './containers/test/Components';
|
|||
|
||||
|
||||
export class Routes extends React.Component<any, any> {
|
||||
constructor(props: any, context: any) {
|
||||
super(props, context);
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
|
|
|
@ -94,7 +94,7 @@ export class TopBar extends React.Component<any, any> {
|
|||
<Icon name='setting' size='large' />
|
||||
</Menu.Item>
|
||||
<Menu.Item onClick={() => {
|
||||
this.setState({ notification_visible: !this.state.notification_visible })
|
||||
this.props.onSidebar();
|
||||
}}>
|
||||
<Label color='teal' horizontal>22</Label>
|
||||
</Menu.Item>
|
||||
|
|
|
@ -12,7 +12,7 @@ export class Header extends React.Component<any, any> {
|
|||
|
||||
render() {
|
||||
return (
|
||||
<TopBar/>
|
||||
<TopBar onSidebar={this.props.onSidebar}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,13 +14,18 @@ export class Layout extends React.Component<any, any> {
|
|||
constructor(props: any, context: any) {
|
||||
super(props, context);
|
||||
this.state = {
|
||||
notification_visible:false,
|
||||
};
|
||||
}
|
||||
|
||||
onSidebar = () => {
|
||||
this.setState({notification_visible:!this.state.notification_visible})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Header />
|
||||
<Header onSidebar={this.onSidebar.bind(this)}/>
|
||||
<Sidebar.Pushable as={Segment} vertical >
|
||||
<Sidebar
|
||||
as={Menu}
|
||||
|
@ -48,13 +53,8 @@ export class Layout extends React.Component<any, any> {
|
|||
|
||||
<Sidebar.Pusher >
|
||||
<Segment vertical>
|
||||
|
||||
<button placeholder='menu' onClick={() => {
|
||||
this.setState({ notification_visible: !this.state.notification_visible })
|
||||
}}> sidebar </button>
|
||||
|
||||
<Container>
|
||||
<Router history={history}>
|
||||
<Router history={history} >
|
||||
<Routes />
|
||||
</Router>
|
||||
</Container>
|
||||
|
|
Loading…
Reference in New Issue
Block a user