Skip to content

Commit

Permalink
Merge pull request #101 from bakaqc/feature/implement-user-list_thang
Browse files Browse the repository at this point in the history
add: login admin
  • Loading branch information
thanglp163 authored Jan 9, 2025
2 parents 77aca6d + 1b2a5b9 commit fe522ea
Show file tree
Hide file tree
Showing 40 changed files with 459 additions and 130 deletions.
46 changes: 25 additions & 21 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const App: React.FC = () => {
<div className="overflow-hidden">
<Routes>
<Route path="/*" element={<UserRoutes />} />
<Route path="/admin/*" element={<AdminRoutes />} />
<Route path="/quan-tri-vien/*" element={<AdminRoutes />} />
</Routes>
<ToastContainer position="top-center" />
</div>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/axiosConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import axios, { AxiosResponse, InternalAxiosRequestConfig } from 'axios';

import { apiBaseUrl } from '@/utils/apiBase';

const instance = axios.create({
baseURL: import.meta.env.VITE_BACKEND_URL,
baseURL: apiBaseUrl,
});

// Add a request interceptor
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { NavLink } from 'react-router-dom';

import hero from '@/assets/hero.jpg';
import { path } from '@/ultils/constant';
import { path } from '@/utils/constant';

const Banner: React.FC = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/InputField.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Payload } from '@/ultils/type';
import { Payload } from '@/utils/type';

interface InputFieldProps {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/InputForLogin.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PayloadForLogin } from '@/ultils/type';
import { PayloadForLogin } from '@/utils/type';

interface InputFieldProps {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/InputForOTP.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PayloadForOtp } from '@/ultils/type';
import { PayloadForOtp } from '@/utils/type';

interface InputFieldProps {
id: string;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Intro.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { text } from '../ultils/dataIntro';
import icons from '../ultils/icons';
import { text } from '../utils/dataIntro';
import icons from '../utils/icons';
import React, { memo } from 'react';

const { FaStar } = icons;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import profile from '@/assets/profile.png';
import setting from '@/assets/setting.png';
import userIcon from '@/assets/user.png';
import voucher from '@/assets/voucher.png';
import { path } from '@/ultils/constant';
import { path } from '@/utils/constant';

const menuItems = [
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { memo } from 'react';

import { Payload } from '@/ultils/type';
import { Payload } from '@/utils/type';

interface SelectProps {
label?: string;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/TopBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import icons from '@/ultils/icons';
import icons from '@/utils/icons';

const { FaBirthdayCake, BiPhoneCall, BiEnvelope } = icons;

Expand Down
36 changes: 36 additions & 0 deletions frontend/src/components/commons/LoginInputField.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import InputForLogin from '../InputForLogin';
import React from 'react';

interface LoginInputFieldProps {
id: string;
label: string;
type: string;
invalidField: { name: string; msg: string }[];
value: string;
setValue: (value: any) => void;
setInvalidField: (value: any) => void;
}

const LoginInputField: React.FC<LoginInputFieldProps> = ({
id,
label,
type,
invalidField,
value,
setValue,
setInvalidField,
}) => {
return (
<InputForLogin
id={id}
label={label}
type={type}
invalidField={invalidField}
value={value}
setValue={setValue}
setInvalidField={setInvalidField}
/>
);
};

export default LoginInputField;
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;
2 changes: 1 addition & 1 deletion frontend/src/containers/public/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import bg from '@/assets/bg.jpg';
// Đảm bảo đường dẫn chính xác
import icons from '@/ultils/icons';
import icons from '@/utils/icons';

const {
FaBirthdayCake,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/containers/public/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';

import logo1 from '@/assets/logo1.png';
import { Button } from '@/components';
import icons from '@/ultils/icons';
import icons from '@/utils/icons';

const { CiLogin, RiAdminLine, RiUserLine } = icons;

Expand Down
62 changes: 0 additions & 62 deletions frontend/src/containers/public/LoginAdmin.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions frontend/src/containers/public/LoginUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { ButtonForLogin, InputForLogin } from '@/components';
import { AppDispatch } from '@/redux';
import * as actions from '@/stores/actions';
import { RootState } from '@/stores/reducers/rootReducer';
import { path } from '@/ultils/constant';
import { PayloadForLogin } from '@/ultils/type';
import validate from '@/ultils/validateField';
import { path } from '@/utils/constant';
import { PayloadForLogin } from '@/utils/type';
import validate from '@/utils/validateField';

interface InvalidField {
name: string;
Expand Down
Loading

0 comments on commit fe522ea

Please sign in to comment.