Fix navbar not sticky

This commit is contained in:
Daniel Schädler 2025-03-16 16:31:26 +01:00
parent 7cff7bdb0b
commit d5a754ba73
1 changed files with 3 additions and 9 deletions

View File

@ -10,22 +10,16 @@ import {notify} from 'react-notify-toast';
export class TurniereNavigation extends React.Component { export class TurniereNavigation extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.toggle = this.toggle.bind(this); this.toggle = this.toggle.bind(this);
this.state = {collapsed: true};
this.state = {
collapsed: true
};
} }
toggle() { toggle() {
this.setState({ this.setState({collapsed: !this.state.collapsed});
collapsed: !this.state.collapsed
});
} }
render() { render() {
return (<Navbar color="light" light expand="lg"> return (<Navbar color="light" light expand="lg" sticky="top">
<NavbarBrand href="/">turnie.re</NavbarBrand> <NavbarBrand href="/">turnie.re</NavbarBrand>
<NavbarToggler onClick={this.toggle}/> <NavbarToggler onClick={this.toggle}/>
<Collapse isOpen={!this.state.collapsed} navbar> <Collapse isOpen={!this.state.collapsed} navbar>