From b35c28d461c231d48db8cfd3f5348093c60c8978 Mon Sep 17 00:00:00 2001 From: Le Thang Date: Thu, 9 Jan 2025 12:45:02 +0700 Subject: [PATCH] fix: fix sonar duplicated --- .../components/commons/RegisterSection.tsx | 17 +++++++++++ .../src/components/commons/RightColumn.tsx | 17 +++++++++++ frontend/src/containers/public/index.ts | 1 - frontend/src/containers/system/LoginAdmin.tsx | 29 ++++--------------- frontend/src/containers/system/index.ts | 1 + frontend/src/routes/admin/AdminRoutes.tsx | 3 +- 6 files changed, 41 insertions(+), 27 deletions(-) create mode 100644 frontend/src/components/commons/RegisterSection.tsx create mode 100644 frontend/src/components/commons/RightColumn.tsx diff --git a/frontend/src/components/commons/RegisterSection.tsx b/frontend/src/components/commons/RegisterSection.tsx new file mode 100644 index 0000000..dcd947e --- /dev/null +++ b/frontend/src/components/commons/RegisterSection.tsx @@ -0,0 +1,17 @@ +import { NavLink } from 'react-router-dom'; + +import { path } from '@/utils/constant'; + +const RegisterSection = () => ( +
+

Don't have an account?

+ + Register + +
+); + +export default RegisterSection; diff --git a/frontend/src/components/commons/RightColumn.tsx b/frontend/src/components/commons/RightColumn.tsx new file mode 100644 index 0000000..083136a --- /dev/null +++ b/frontend/src/components/commons/RightColumn.tsx @@ -0,0 +1,17 @@ +const RightColumn = () => ( +
+
+

+ We are more than just a company +

+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim + veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea + commodo consequat. +

+
+
+); + +export default RightColumn; diff --git a/frontend/src/containers/public/index.ts b/frontend/src/containers/public/index.ts index d738596..7c2f2c9 100644 --- a/frontend/src/containers/public/index.ts +++ b/frontend/src/containers/public/index.ts @@ -1,7 +1,6 @@ export { default as Header } from '@/containers/public/Header'; export { default as Footer } from '@/containers/public/Footer'; export { default as LoginUser } from '@/containers/public/LoginUser'; -export { default as LoginAdmin } from '@/containers/public/LoginAdmin'; export { default as RegisterUser } from '@/containers/public/RegisterUser'; export { default as VerifyOTP } from '@/containers/public/VerifyOTP'; export { default as Home } from '@/containers/public/Home'; diff --git a/frontend/src/containers/system/LoginAdmin.tsx b/frontend/src/containers/system/LoginAdmin.tsx index 72b6d2d..e1f9b3e 100644 --- a/frontend/src/containers/system/LoginAdmin.tsx +++ b/frontend/src/containers/system/LoginAdmin.tsx @@ -1,13 +1,14 @@ import { useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { NavLink, useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import logo1 from '@/assets/logo1.png'; import { ButtonForLogin, InputForLogin } from '@/components'; +import RegisterSection from '@/components/commons/RegisterSection'; +import RightColumn from '@/components/commons/RightColumn'; import { AppDispatch } from '@/redux'; import * as actions from '@/stores/actions'; import { RootState } from '@/stores/reducers/rootReducer'; -import { path } from '@/utils/constant'; import { PayloadForLogin } from '@/utils/type'; import validate from '@/utils/validateField'; @@ -83,31 +84,11 @@ const LoginAdmin: React.FC = () => { {/* Register Section */} -
-

Don't have an account?

- - Register - -
+ {/* Right Column */} -
-
-

- We are more than just a company -

-

- Lorem ipsum dolor sit amet, consectetur adipisicing elit, - sed do eiusmod tempor incididunt ut labore et dolore magna - aliqua. Ut enim ad minim veniam, quis nostrud exercitation - ullamco laboris nisi ut aliquip ex ea commodo consequat. -

-
-
+ diff --git a/frontend/src/containers/system/index.ts b/frontend/src/containers/system/index.ts index eea5217..ff7b33b 100644 --- a/frontend/src/containers/system/index.ts +++ b/frontend/src/containers/system/index.ts @@ -1,2 +1,3 @@ export { default as AdminPage } from '@/containers/system/AdminPage'; export { default as ManageUser } from '@/containers/system/ManageUser'; +export { default as LoginAdmin } from '@/containers/system/LoginAdmin'; diff --git a/frontend/src/routes/admin/AdminRoutes.tsx b/frontend/src/routes/admin/AdminRoutes.tsx index ecc8364..b0f3cb4 100644 --- a/frontend/src/routes/admin/AdminRoutes.tsx +++ b/frontend/src/routes/admin/AdminRoutes.tsx @@ -1,8 +1,7 @@ import React from 'react'; import { Route, Routes } from 'react-router-dom'; -import { LoginAdmin } from '@/containers/public'; -import { AdminPage, ManageUser } from '@/containers/system'; +import { AdminPage, LoginAdmin, ManageUser } from '@/containers/system'; import { path } from '@/utils/constant'; const AdminRoutes: React.FC = () => {