From 021aa25e02546d8ae5bd018c8df654e1c0d322a9 Mon Sep 17 00:00:00 2001 From: Adrian Smijulj Date: Thu, 16 Jan 2025 11:41:22 +0100 Subject: [PATCH] fix: remove `TopProgressBar` component (#4493) --- packages/ui/package.json | 2 -- packages/ui/src/TopProgressBar/README.md | 11 -------- .../ui/src/TopProgressBar/TopProgressBar.tsx | 24 ------------------ packages/ui/src/TopProgressBar/hoc/index.ts | 1 - .../TopProgressBar/hoc/withTopProgressBar.tsx | 25 ------------------- packages/ui/src/TopProgressBar/index.ts | 1 - packages/ui/src/TopProgressBar/style.scss | 21 ---------------- yarn.lock | 2 -- 8 files changed, 87 deletions(-) delete mode 100644 packages/ui/src/TopProgressBar/README.md delete mode 100644 packages/ui/src/TopProgressBar/TopProgressBar.tsx delete mode 100644 packages/ui/src/TopProgressBar/hoc/index.ts delete mode 100644 packages/ui/src/TopProgressBar/hoc/withTopProgressBar.tsx delete mode 100644 packages/ui/src/TopProgressBar/index.ts delete mode 100644 packages/ui/src/TopProgressBar/style.scss diff --git a/packages/ui/package.json b/packages/ui/package.json index 09c1e95d116..eecdacbbd28 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -39,7 +39,6 @@ "load-script": "^1.0.0", "lodash": "^4.17.21", "material-components-web": "^14.0.0", - "nprogress": "^0.2.0", "nuka-carousel": "4.7.1", "react-butterfiles": "^1.3.3", "react-color": "^2.19.3", @@ -52,7 +51,6 @@ "devDependencies": { "@emotion/babel-plugin": "^11.11.0", "@testing-library/react": "^15.0.7", - "@types/nprogress": "^0.2.0", "@types/react-color": "^2.17.11", "@types/react-custom-scrollbars": "^4.0.10", "@types/react-transition-group": "^4.4.4", diff --git a/packages/ui/src/TopProgressBar/README.md b/packages/ui/src/TopProgressBar/README.md deleted file mode 100644 index b602420074e..00000000000 --- a/packages/ui/src/TopProgressBar/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# TopProgressBar - -### Description - -Use `TopProgressBar` to let users know their actions are being processed. - -### Import - -```js -import { TopProgressBar } from "@webiny/ui/TopProgressBar"; -``` diff --git a/packages/ui/src/TopProgressBar/TopProgressBar.tsx b/packages/ui/src/TopProgressBar/TopProgressBar.tsx deleted file mode 100644 index d02ea78ea4c..00000000000 --- a/packages/ui/src/TopProgressBar/TopProgressBar.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from "react"; -import nprogress from "nprogress"; -import "./style.scss"; - -export interface TopProgressBarRender { - start: () => void; - finish: () => void; - nprogress: typeof nprogress; -} - -export interface TopProgressBarProps { - /** - * Elements that require top loading bar to be shown. - */ - children: (params: TopProgressBarRender) => React.ReactElement; -} - -export const TopProgressBar = (props: TopProgressBarProps) => { - return props.children({ - start: nprogress.start, - finish: nprogress.done, - nprogress - }); -}; diff --git a/packages/ui/src/TopProgressBar/hoc/index.ts b/packages/ui/src/TopProgressBar/hoc/index.ts deleted file mode 100644 index 9ca0173b8ff..00000000000 --- a/packages/ui/src/TopProgressBar/hoc/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as withTopProgressBar } from "./withTopProgressBar"; diff --git a/packages/ui/src/TopProgressBar/hoc/withTopProgressBar.tsx b/packages/ui/src/TopProgressBar/hoc/withTopProgressBar.tsx deleted file mode 100644 index ff299f46949..00000000000 --- a/packages/ui/src/TopProgressBar/hoc/withTopProgressBar.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import React from "react"; -import { TopProgressBar } from ".."; - -const withTopProgressBar = () => { - return (BaseComponent: React.ComponentType) => { - const WithTopProgressBar = (props: any) => { - return ( - - {({ start, finish, nprogress }) => ( - - )} - - ); - }; - - return WithTopProgressBar; - }; -}; - -export default withTopProgressBar; diff --git a/packages/ui/src/TopProgressBar/index.ts b/packages/ui/src/TopProgressBar/index.ts deleted file mode 100644 index f885bc298ce..00000000000 --- a/packages/ui/src/TopProgressBar/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./TopProgressBar"; diff --git a/packages/ui/src/TopProgressBar/style.scss b/packages/ui/src/TopProgressBar/style.scss deleted file mode 100644 index d2ae4d4c0b0..00000000000 --- a/packages/ui/src/TopProgressBar/style.scss +++ /dev/null @@ -1,21 +0,0 @@ -/* Make clicks pass-through */ -#nprogress { - pointer-events: none; -} - -#nprogress .bar { - background: var(--mdc-theme-secondary); - - position: fixed; - z-index: 1031; - top: 64px; - left: 0; - - width: 100%; - height: 2px; -} - -/* Fancy blur effect */ -#nprogress .peg { - display: none; -} diff --git a/yarn.lock b/yarn.lock index 0f52185306a..a53b57ab1e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19580,7 +19580,6 @@ __metadata: "@svgr/webpack": "npm:^6.1.1" "@tanstack/react-table": "npm:^8.5.22" "@testing-library/react": "npm:^15.0.7" - "@types/nprogress": "npm:^0.2.0" "@types/react-color": "npm:^2.17.11" "@types/react-custom-scrollbars": "npm:^4.0.10" "@types/react-transition-group": "npm:^4.4.4" @@ -19601,7 +19600,6 @@ __metadata: lodash: "npm:^4.17.21" material-components-web: "npm:^14.0.0" ncp: "npm:^2.0.0" - nprogress: "npm:^0.2.0" nuka-carousel: "npm:4.7.1" raw-loader: "npm:^4.0.2" react-butterfiles: "npm:^1.3.3"