Skip to content

Commit

Permalink
Merge pull request #9 from hotungkhanh/kan-56/frontend-persistence
Browse files Browse the repository at this point in the history
feat: store user input data in indexedDB; remove sessionStorage
  • Loading branch information
NguyenDonLam authored Sep 15, 2024
2 parents 3d0a34d + 0e4a78f commit 60b407a
Show file tree
Hide file tree
Showing 14 changed files with 354 additions and 112 deletions.
183 changes: 182 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
"@mui/base": "^5.0.0-beta.40",
"@mui/icons-material": "^5.16.7",
"@mui/material": "^5.16.7",
"dexie": "^4.0.8",
"dexie-react-hooks": "^1.1.7",
"jspreadsheet-ce": "^4.2.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.1"
"react-router-dom": "^6.26.1",
"read-excel-file": "^5.8.5"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/components/ProceedButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ interface ProceedButtonProps {
fileChosen: File | null;
}

export default function ProceedButton({ fileChosen }:ProceedButtonProps) {
const navigate = useNavigate();
if (fileChosen === null) {
return <Button disabled> Proceed </Button>
} else {
return <Button onClick={() => navigate("/seminfo/campus")}> Proceed</Button>;
}
}` `
export default function ProceedButton({ fileChosen }: ProceedButtonProps) {
const navigate = useNavigate();
if (fileChosen === null) {
return <Button disabled> Proceed </Button>
} else {
return <Button onClick={() => navigate("/seminfo/building")}> Proceed</Button>;
}
}
17 changes: 0 additions & 17 deletions frontend/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ export default function Sidebar({ marginTop, width }: SidebarProps) {
anchor="left"
>
<List>
<ListItem key="Campus" disablePadding>
<ListItemButton component={Link} to="campus">
<ListItemIcon>
<InboxIcon />
</ListItemIcon>
<ListItemText primary="Campus" />
</ListItemButton>
</ListItem>

<ListItem key="Building" disablePadding>
<ListItemButton component={Link} to="building">
Expand All @@ -59,15 +51,6 @@ export default function Sidebar({ marginTop, width }: SidebarProps) {
</ListItemButton>
</ListItem>

<ListItem key="Course" disablePadding>
<ListItemButton component={Link} to="course">
<ListItemIcon>
<InboxIcon />
</ListItemIcon>
<ListItemText primary="Course" />
</ListItemButton>
</ListItem>

<ListItem key="Unit" disablePadding>
<ListItemButton component={Link} to="unit">
<ListItemIcon>
Expand Down
Loading

0 comments on commit 60b407a

Please sign in to comment.