Reorganize app pages (#73)

* Update layout and menus

* Add breadcrumbs
Add menu icons
Add ECU drop down

* Implement submenu
Update download progress

* revamped dashboard section - failing app.test.js

* Clean up

Co-authored-by: Drew Taylor <dtaylor@fiskerinc.com>
This commit is contained in:
John Wu
2021-08-10 08:11:06 -07:00
committed by GitHub
parent 0545b54daf
commit e50eb886e6
39 changed files with 4043 additions and 3623 deletions

View File

@@ -76,15 +76,17 @@ export const CarUpdatesProvider = ({ children }) => {
};
const applyProgressStatus = (item, status) => {
if (status.msg === "DONE") {
if (status.msg === "package_download_complete") {
delete item.progress;
item.status = "downloaded";
} else if (status.msg === "downloading" && status.total > 0) {
let progress = Math.floor((100 * status.bytes) / status.total);
} else if (status.msg === "downloading" && status.package_total > 0) {
let progress = Math.floor(
(100 * status.package_current) / status.package_total
);
if (progress > 99) progress = 0;
item.progress = progress;
item.status = `downloading ${progress}%`;
} else if (status.error > 0) {
} else if (status.error > 0 || status.msg === "download_error") {
item.status = "download error";
} else {
item.status = "downloading";