From 698765017b3bd9e8595e2f3b640c3b470150c791 Mon Sep 17 00:00:00 2001 From: 21120447 Date: Wed, 12 Jun 2024 09:21:16 +0700 Subject: [PATCH] fix: input number chapter equal 0, admin information page --- src/components/Export/ButtonDownload.tsx | 8 ++- src/constants/admin.json | 44 -------------- src/pages/Information/AboutUs.tsx | 77 +++++++++++++++--------- 3 files changed, 54 insertions(+), 75 deletions(-) delete mode 100644 src/constants/admin.json diff --git a/src/components/Export/ButtonDownload.tsx b/src/components/Export/ButtonDownload.tsx index 5a9f248..982fa9a 100644 --- a/src/components/Export/ButtonDownload.tsx +++ b/src/components/Export/ButtonDownload.tsx @@ -15,11 +15,15 @@ interface Props { const ButtonDownload = ({ novelId, file, server, chapterId, numberChapters, close, setErrorMessage }: Props) => { function checkNumberChaptersIsValid(numberChapters: number | ""): boolean { if (numberChapters === undefined || numberChapters === null || numberChapters === "") { - setErrorMessage("Vui lòng nhập số chương muốn tải"); + setErrorMessage("Vui lòng nhập số chương muốn tải."); + return false; + } + if (numberChapters <= 0) { + setErrorMessage("Số chương tải phải lớn hơn 0."); return false; } if (numberChapters > 300) { - setErrorMessage("Chỉ có thể tải tối đa 300 chương"); + setErrorMessage("Chỉ có thể tải tối đa 300 chương."); return false; } return true; diff --git a/src/constants/admin.json b/src/constants/admin.json deleted file mode 100644 index 0a1291f..0000000 --- a/src/constants/admin.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "admin": [ - { - "name": "Nguyễn Nhật Hào", - "githubUrl": "https://github.com/nxhawk", - "facebookUrl": "https://www.facebook.com/", - "border": "border-sky-600", - "shadow": "shadow-sky-600/100", - "color_1": "text-sky-700", - "color_2": "text-sky-500", - "hover_color_2": "hover:text-sky-500" - }, - { - "name": "Tô Phương Hiếu", - "githubUrl": "https://github.com/phuonghieuto", - "facebookUrl": "https://www.facebook.com/", - "border": "border-red-600", - "shadow": "shadow-red-600/100", - "color_1": "text-red-700", - "color_2": "text-red-500", - "hover_color_2": "hover:text-red-500" - }, - { - "name": "Trương Văn Hoài", - "githubUrl": "https://github.com/hcdman", - "facebookUrl": "https://www.facebook.com/", - "border": "border-indigo-600", - "shadow": "shadow-indigo-600/100", - "color_1": "text-indigo-700", - "color_2": "text-indigo-500", - "hover_color_2": "hover:text-indigo-500" - }, - { - "name": "Lê Minh Hoàng", - "githubUrl": "https://github.com/mihoag", - "facebookUrl": "https://www.facebook.com/", - "border": "border-green-600", - "shadow": "shadow-green-600/100", - "color_1": "text-green-700", - "color_2": "text-green-500", - "hover_color_2": "hover:text-green-500" - } - ] -} \ No newline at end of file diff --git a/src/pages/Information/AboutUs.tsx b/src/pages/Information/AboutUs.tsx index eeb7cfe..e632540 100644 --- a/src/pages/Information/AboutUs.tsx +++ b/src/pages/Information/AboutUs.tsx @@ -6,22 +6,8 @@ import admin_04 from "../../assets/images/admin/admin_04.jpg"; import TitleTabScroll from "../../components/TitleTabScroll"; import MyHelmet from "../../components/MyHelmet"; import UserCard from "../../components/UserCard"; -import AdminInformation from "../../constants/admin.json"; const AboutUs = () => { - function getImageAdmin(index: number) { - switch (index) { - case 0: - return admin_01; - case 1: - return admin_02; - case 2: - return admin_03; - default: - return admin_04; - } - } - return (
@@ -34,21 +20,54 @@ const AboutUs = () => {
- {AdminInformation["admin"].map((admin, idx) => ( - - ))} + + + +
);