Skip to content

Commit

Permalink
Merge pull request #53 from hotungkhanh/kan-92/general-fine-tuning
Browse files Browse the repository at this point in the history
fix: styling of sidebar + header + footer
  • Loading branch information
dh-giang-vu authored Oct 17, 2024
2 parents 29bcd85 + d060d5f commit 624ebaa
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 29 deletions.
40 changes: 25 additions & 15 deletions frontend/src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
import { Box } from "@mui/material";
import { AppBar, Box, CssBaseline } from "@mui/material";
import VIT_Logo from '../assets/logo.png';

/**
* React component for rendering the header section.
* @returns JSX element representing the header with a logo.
*/
export default function Header() {
const headerStyle = {
backgroundColor: "#F5F5f5",
color: "white",
padding: "20px",
textAlign: "left",
height: "12vh"
};
return (
<Box className="header" sx={headerStyle}>
<img
src={VIT_Logo}
alt="logo.exe"
height="90%"
width="auto"
/>
<Box sx={{ height: "130px", margin: "0" }}>
<CssBaseline />
<AppBar
position="fixed"
sx={{
zIndex: (theme) => theme.zIndex.drawer + 1,
height: "130px",
padding: "20px",
backgroundColor: "#F5F5f5",
boxShadow: "none"
}}
>
<img
src={VIT_Logo}
alt="logo.exe"
style={{width: "230px",
height: "auto",
// objectFit: "contain",
// maxHeight: "100%",
// maxWidth: "100%",
// alignSelf: "flex-start", // Aligns left in a flex container
}}
/>
</AppBar>
</Box>
);
}
12 changes: 5 additions & 7 deletions frontend/src/components/ModSiderbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import LocationCityIcon from "@mui/icons-material/LocationCity";
import GanttChart from "./GanttChart";
import { TimetableSolution } from "../scripts/api";
import { useState } from "react";
import { ListItemIcon } from "@mui/material";
import { Box, ListItemIcon } from "@mui/material";

interface SidebarProps {
marginTop: number;
Expand Down Expand Up @@ -40,12 +40,12 @@ export default function ModSidebar({ marginTop, width }: SidebarProps) {
"& .MuiDrawer-paper": {
width: drawerWidth,
boxSizing: "border-box",
marginTop: marginTop,
},
}}
variant="permanent"
anchor="left"
>
<Box sx={{ height: marginTop + "px"}} />
<List>
{campusSolutions && campusSolutions.length > 0 ? (
campusSolutions.map((solution) => {
Expand All @@ -64,11 +64,9 @@ export default function ModSidebar({ marginTop, width }: SidebarProps) {
}}
>
<ListItemIcon>
<LocationCityIcon/>
<LocationCityIcon />
</ListItemIcon>
<ListItemText
primary={campusName}
/>
<ListItemText primary={campusName} />
</ListItemButton>
</ListItem>
);
Expand All @@ -89,7 +87,7 @@ export default function ModSidebar({ marginTop, width }: SidebarProps) {
<Route
key={campusName}
path={`timetablemod/${campusName.toLowerCase()}`}
element={<GanttChart/>}
element={<GanttChart />}
/>
);
})}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import SchoolIcon from "@mui/icons-material/School";
import MeetingRoomIcon from "@mui/icons-material/MeetingRoom";

import { Link } from "react-router-dom";
import { Box } from "@mui/material";


interface SidebarProps {
Expand All @@ -34,12 +35,12 @@ export default function Sidebar({ marginTop, width }: SidebarProps) {
"& .MuiDrawer-paper": {
width: drawerWidth,
boxSizing: "border-box",
marginTop: marginTop,
},
}}
variant="permanent"
anchor="left"
>
<Box sx={{height: marginTop + "px"}} />
<List>
<ListItem key="Room" disablePadding>
<ListItemButton component={Link} to="room">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/UploadPopUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function UploadPopUp() {
onClose={handleClose}
slots={{ backdrop: StyledBackdrop }}
>
<ModalContent sx={{ width: 500, height: 120 }}>
<ModalContent sx={{ width: 500, height: 180 }}>
<DisplayFile fileChosen={fileChosen}/>
<UploadButton setFileChosen={setFileChosen}></UploadButton>
<ProceedButton fileChosen={fileChosen}></ProceedButton>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/SemesterInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import BackButton from "../components/BackButton.tsx";
export default function SemesterInfo() {
return (
<div>
<Header />
<Sidebar width={240} marginTop={16}/>
<Header />
<Sidebar width={240} marginTop={130}/>

{/* Spreadsheet */}
<div style={{ marginLeft: 300 + "px", overflow: "hidden" }}>
Expand All @@ -31,5 +31,5 @@ export default function SemesterInfo() {
</Footer>

</div>
)
);
}
2 changes: 1 addition & 1 deletion frontend/src/pages/TimetableMod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function TimetableMod() {
return (
<div>
<Header />
<ModSidebar width={240} marginTop={16} />
<ModSidebar width={240} marginTop={130} />

<div
style={{
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/styles/enrolment.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

.description {
margin: 13%;
margin: 5% 10% 10% 10%;
}

.description span {
Expand Down

0 comments on commit 624ebaa

Please sign in to comment.