Skip to content

Commit

Permalink
fix: input number chapter equal 0, admin information page
Browse files Browse the repository at this point in the history
  • Loading branch information
nxhawk committed Jun 12, 2024
1 parent 2598bbf commit 6987650
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 75 deletions.
8 changes: 6 additions & 2 deletions src/components/Export/ButtonDownload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
44 changes: 0 additions & 44 deletions src/constants/admin.json

This file was deleted.

77 changes: 48 additions & 29 deletions src/pages/Information/AboutUs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="font-sans flex flex-col text-black dark:text-white">
<MyHelmet title={"Nhóm Phát Triển"} description={"Web tổng hợp và đọc tiểu thuyết trực tuyến"} />
Expand All @@ -34,21 +20,54 @@ const AboutUs = () => {
</div>

<div className="flex flex-col gap-2 text-lg md:mt-6 mt-2">
{AdminInformation["admin"].map((admin, idx) => (
<UserCard
key={admin.name}
name={admin.name}
imageURL={getImageAdmin(idx)}
githubUrl={admin.githubUrl}
facebookUrl={admin.facebookUrl}
border={admin.border}
shadow={admin.shadow}
color_1={admin.color_1}
color_2={admin.color_2}
hover_color_2={admin.hover_color_2}
isEnd={idx % 2 == 1}
/>
))}
<UserCard
name="Nguyễn Nhật Hào"
imageURL={admin_01}
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"
isEnd={false}
/>
<UserCard
name="Tô Phương Hiếu"
imageURL={admin_02}
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"
isEnd={true}
/>
<UserCard
name="Trương Văn Hoài"
imageURL={admin_03}
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"
isEnd={false}
/>
<UserCard
name="Lê Minh Hoàng"
imageURL={admin_04}
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"
isEnd={true}
/>
</div>
</div>
);
Expand Down

0 comments on commit 6987650

Please sign in to comment.