Newer
Older
import React from "react";
import "./App.scss";
import TopBar from "./organisms/TopBar";
import BottomBar from "./organisms/BottomBar";
import StandardView from "./pages/StandardView";
this.state = { toggledLeft: false, toggledRight: false };
}
componentDidMount() {
let interfaceSize = localStorage.getItem("interfaceSize");
if (interfaceSize) {
document.documentElement.style.fontSize = `${interfaceSize}%`;
}
window.addEventListener('resize', () => this.showOrHideSideBars());
this.showOrHideSideBars();
}
if (window.innerWidth <= 1024) {
this.setState({
toggledRight: false,
});
}
this.setState((state) => ({
toggledLeft: !state.toggledLeft,
}));
this.setState((state) => ({
toggledRight: !state.toggledRight,
}));
showOrHideSideBars(){
if (window.innerWidth <= 1024) {
this.setState({
toggledLeft: false,
toggledRight: false,
});
} else{
this.setState({
toggledLeft: true,
toggledRight: true,
});
}
}
render() {
const horizontalBarPages = [
{ name: "Dashboard", path: "/dashboard", icon: faHome },
{ name: "Modules", path: "/modules", icon: faChalkboardTeacher },
{ name: "Timeline", path: "/timeline", icon: faCalendarWeek },
{ name: "Exams", path: "/exams", icon: faBookOpen },
/>
<StandardView
pages={horizontalBarPages}
toggledLeft={this.state.toggledLeft}
e.preventDefault();
this.setState({ toggledLeft: false, toggledRight: false });
}}
<BottomBar pages={horizontalBarPages} />
</>
);
}
}