Skip to content

Commit

Permalink
fix: fix sonar duplicated
Browse files Browse the repository at this point in the history
  • Loading branch information
Le Thang committed Jan 9, 2025
1 parent 63a79e4 commit b35c28d
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 27 deletions.
17 changes: 17 additions & 0 deletions frontend/src/components/commons/RegisterSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { NavLink } from 'react-router-dom';

import { path } from '@/utils/constant';

const RegisterSection = () => (
<div className="flex items-center justify-between">
<p className="text-sm">Don't have an account?</p>
<NavLink
to={path.REGISTER_USER}
className="rounded border border-red-500 px-4 py-2 text-sm text-red-500 hover:bg-red-50"
>
Register
</NavLink>
</div>
);

export default RegisterSection;
17 changes: 17 additions & 0 deletions frontend/src/components/commons/RightColumn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const RightColumn = () => (
<div className="flex items-center justify-center rounded-b-lg bg-gradient-to-r from-yellow-500 via-orange-500 to-amber-700 lg:w-6/12 lg:rounded-e-lg lg:rounded-bl-none">
<div className="px-6 py-8 text-white md:px-8">
<h4 className="mb-6 text-xl font-semibold">
We are more than just a company
</h4>
<p className="text-sm">
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.
</p>
</div>
</div>
);

export default RightColumn;
1 change: 0 additions & 1 deletion frontend/src/containers/public/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
29 changes: 5 additions & 24 deletions frontend/src/containers/system/LoginAdmin.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -83,31 +84,11 @@ const LoginAdmin: React.FC = () => {
</div>

{/* Register Section */}
<div className="flex items-center justify-between">
<p className="text-sm">Don't have an account?</p>
<NavLink
to={path.REGISTER_USER}
className="rounded border border-red-500 px-4 py-2 text-sm text-red-500 hover:bg-red-50"
>
Register
</NavLink>
</div>
<RegisterSection />
</div>

{/* Right Column */}
<div className="flex items-center justify-center rounded-b-lg bg-gradient-to-r from-yellow-500 via-orange-500 to-amber-700 lg:w-6/12 lg:rounded-e-lg lg:rounded-bl-none">
<div className="px-6 py-8 text-white md:px-8">
<h4 className="mb-6 text-xl font-semibold">
We are more than just a company
</h4>
<p className="text-sm">
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.
</p>
</div>
</div>
<RightColumn />
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/containers/system/index.ts
Original file line number Diff line number Diff line change
@@ -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';
3 changes: 1 addition & 2 deletions frontend/src/routes/admin/AdminRoutes.tsx
Original file line number Diff line number Diff line change
@@ -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 = () => {
Expand Down

0 comments on commit b35c28d

Please sign in to comment.