From ec28d9e82c540ea1068795c6303388e4d67f5ceb Mon Sep 17 00:00:00 2001 From: Pablo Ferro Date: Fri, 4 Mar 2022 10:09:58 -0300 Subject: [PATCH] refactor: Remove dashboard --- README.md | 3 --- .../src/components/Routes/constants.tsx | 4 ++-- .../templates/src/components/Routes/index.tsx | 19 ++++++++----------- .../templates/src/screens/Dashboard/index.tsx | 12 ------------ .../screens => }/Home/assets/logo.svg | 0 .../screens => }/Home/context/index.test.ts | 0 .../screens => }/Home/context/index.ts | 0 .../screens => }/Home/context/reducer.test.ts | 0 .../screens => }/Home/context/reducer.ts | 0 .../{Dashboard/screens => }/Home/i18n.ts | 0 .../screens => }/Home/index.test.tsx | 0 .../{Dashboard/screens => }/Home/index.tsx | 0 .../screens => }/Home/styles.module.scss | 0 .../{Dashboard/screens => }/Login/index.tsx | 4 +--- 14 files changed, 11 insertions(+), 31 deletions(-) delete mode 100644 generators/app/templates/src/screens/Dashboard/index.tsx rename generators/app/templates/src/screens/{Dashboard/screens => }/Home/assets/logo.svg (100%) rename generators/app/templates/src/screens/{Dashboard/screens => }/Home/context/index.test.ts (100%) rename generators/app/templates/src/screens/{Dashboard/screens => }/Home/context/index.ts (100%) rename generators/app/templates/src/screens/{Dashboard/screens => }/Home/context/reducer.test.ts (100%) rename generators/app/templates/src/screens/{Dashboard/screens => }/Home/context/reducer.ts (100%) rename generators/app/templates/src/screens/{Dashboard/screens => }/Home/i18n.ts (100%) rename generators/app/templates/src/screens/{Dashboard/screens => }/Home/index.test.tsx (100%) rename generators/app/templates/src/screens/{Dashboard/screens => }/Home/index.tsx (100%) rename generators/app/templates/src/screens/{Dashboard/screens => }/Home/styles.module.scss (100%) rename generators/app/templates/src/screens/{Dashboard/screens => }/Login/index.tsx (57%) diff --git a/README.md b/README.md index ab3885f4..9f137af5 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,6 @@ After that, every time you want to run it you may execute the run script: with t - Spinner - Suspense -###### Screens -- Dashboard - ## Bootstrap libraries ||| diff --git a/generators/app/templates/src/components/Routes/constants.tsx b/generators/app/templates/src/components/Routes/constants.tsx index 29a9520f..3c2b2528 100644 --- a/generators/app/templates/src/components/Routes/constants.tsx +++ b/generators/app/templates/src/components/Routes/constants.tsx @@ -5,8 +5,8 @@ import { User } from 'contexts/UserContext/reducer'; import PATHS from './paths'; -const Home = lazy(() => import('../../screens/Dashboard/screens/Home')); -const Login = lazy(() => import('../../screens/Dashboard/screens/Login')); +const Home = lazy(() => import('../../screens/Home')); +const Login = lazy(() => import('../../screens/Login')); // Add imports for screens above (FOR GENERATORS, DO NOT REMOVE) const MAIN_PUBLIC_PATH = PATHS.login; diff --git a/generators/app/templates/src/components/Routes/index.tsx b/generators/app/templates/src/components/Routes/index.tsx index c0bc2f7a..d1bd00b9 100644 --- a/generators/app/templates/src/components/Routes/index.tsx +++ b/generators/app/templates/src/components/Routes/index.tsx @@ -6,7 +6,6 @@ import Suspense from '../Suspense'; import { ROUTES } from './constants'; import styles from './styles.module.scss'; -import Dashboard from "screens/Dashboard"; function Routes() { const user = useSelector((state) => state.user); @@ -16,16 +15,14 @@ function Routes() {
- }> - {ROUTES.map(({ redirectTo, path, element, ...config }) => ( - : element} - {...config} - /> - ))} - + {ROUTES.map(({ redirectTo, path, element, ...config }) => ( + : element} + {...config} + /> + ))}
diff --git a/generators/app/templates/src/screens/Dashboard/index.tsx b/generators/app/templates/src/screens/Dashboard/index.tsx deleted file mode 100644 index 1ef7fc7a..00000000 --- a/generators/app/templates/src/screens/Dashboard/index.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { Outlet } from 'react-router-dom'; - -function Dashboard() { - return ( -
- -
- ); -} - -export default Dashboard; - diff --git a/generators/app/templates/src/screens/Dashboard/screens/Home/assets/logo.svg b/generators/app/templates/src/screens/Home/assets/logo.svg similarity index 100% rename from generators/app/templates/src/screens/Dashboard/screens/Home/assets/logo.svg rename to generators/app/templates/src/screens/Home/assets/logo.svg diff --git a/generators/app/templates/src/screens/Dashboard/screens/Home/context/index.test.ts b/generators/app/templates/src/screens/Home/context/index.test.ts similarity index 100% rename from generators/app/templates/src/screens/Dashboard/screens/Home/context/index.test.ts rename to generators/app/templates/src/screens/Home/context/index.test.ts diff --git a/generators/app/templates/src/screens/Dashboard/screens/Home/context/index.ts b/generators/app/templates/src/screens/Home/context/index.ts similarity index 100% rename from generators/app/templates/src/screens/Dashboard/screens/Home/context/index.ts rename to generators/app/templates/src/screens/Home/context/index.ts diff --git a/generators/app/templates/src/screens/Dashboard/screens/Home/context/reducer.test.ts b/generators/app/templates/src/screens/Home/context/reducer.test.ts similarity index 100% rename from generators/app/templates/src/screens/Dashboard/screens/Home/context/reducer.test.ts rename to generators/app/templates/src/screens/Home/context/reducer.test.ts diff --git a/generators/app/templates/src/screens/Dashboard/screens/Home/context/reducer.ts b/generators/app/templates/src/screens/Home/context/reducer.ts similarity index 100% rename from generators/app/templates/src/screens/Dashboard/screens/Home/context/reducer.ts rename to generators/app/templates/src/screens/Home/context/reducer.ts diff --git a/generators/app/templates/src/screens/Dashboard/screens/Home/i18n.ts b/generators/app/templates/src/screens/Home/i18n.ts similarity index 100% rename from generators/app/templates/src/screens/Dashboard/screens/Home/i18n.ts rename to generators/app/templates/src/screens/Home/i18n.ts diff --git a/generators/app/templates/src/screens/Dashboard/screens/Home/index.test.tsx b/generators/app/templates/src/screens/Home/index.test.tsx similarity index 100% rename from generators/app/templates/src/screens/Dashboard/screens/Home/index.test.tsx rename to generators/app/templates/src/screens/Home/index.test.tsx diff --git a/generators/app/templates/src/screens/Dashboard/screens/Home/index.tsx b/generators/app/templates/src/screens/Home/index.tsx similarity index 100% rename from generators/app/templates/src/screens/Dashboard/screens/Home/index.tsx rename to generators/app/templates/src/screens/Home/index.tsx diff --git a/generators/app/templates/src/screens/Dashboard/screens/Home/styles.module.scss b/generators/app/templates/src/screens/Home/styles.module.scss similarity index 100% rename from generators/app/templates/src/screens/Dashboard/screens/Home/styles.module.scss rename to generators/app/templates/src/screens/Home/styles.module.scss diff --git a/generators/app/templates/src/screens/Dashboard/screens/Login/index.tsx b/generators/app/templates/src/screens/Login/index.tsx similarity index 57% rename from generators/app/templates/src/screens/Dashboard/screens/Login/index.tsx rename to generators/app/templates/src/screens/Login/index.tsx index a24f41f3..add8424d 100644 --- a/generators/app/templates/src/screens/Dashboard/screens/Login/index.tsx +++ b/generators/app/templates/src/screens/Login/index.tsx @@ -1,9 +1,7 @@ function Login() { return ( -
- login -
+

login

); }