Skip to content

Commit

Permalink
feat: fix bugs & add new pers
Browse files Browse the repository at this point in the history
  • Loading branch information
conganhhcmus committed Mar 17, 2024
1 parent a8b7bfd commit 03c30f3
Show file tree
Hide file tree
Showing 20 changed files with 277 additions and 244 deletions.
5 changes: 5 additions & 0 deletions public/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,10 @@
"reading": "Reading",
"continue-reading": "Continue Reading",
"delete-all": "Delete All",
"price": "Price",
"content": "Content",
"collaborators": "Collaborators",
"update-by": "Update By",
"search-for-users": "Search for users",
"description_0": "The largest online comic reading website updated continuously every day - Join reading and discussing with more than 10 million members 🎉 at YouthBook ❤️💛💚"
}
5 changes: 5 additions & 0 deletions public/language/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,10 @@
"not-found-history": "Không tìm thấy lịch sử",
"continue-reading": "Đọc tiếp",
"delete-all": "Xóa tất cả",
"price": "Giá",
"content": "Nội dung",
"collaborators": "Collaborators",
"update-by": "Người cập nhật",
"search-for-users": "Tìm tài khoản",
"description_0": "Web đọc truyện tranh online lớn nhất được cập nhật liên tục mỗi ngày - Cùng tham gia đọc truyện và thảo luận với hơn 10 triệu thành viên 🎉 tại YouthBook ❤️💛💚"
}
2 changes: 1 addition & 1 deletion src/components/Header/AccountInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const AccountInfo = ({ userInfo }: AccountInfoProps) => {
<span className="mt-[2px] text-xs">{translate('account-page')}</span>
</Link>
<span className="my-1 h-[1px] w-[80%] border-b border-dashed" />
{userInfo.role === ROLES.admin && (
{(userInfo.role === ROLES.admin || userInfo.role === ROLES.collaborators) && (
<>
<Link
title={translate('management-page')}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ const Navbar = () => {
{
title: translate('new-comic-title'),
link: {
pathname: APP_PATH.new,
pathname: APP_PATH.recent,
search: createSearchParams({
type: 'all',
page: '1',
}).toString(),
},
name: translate('new-comic'),
isCurrent: useMatch(APP_PATH.new),
isCurrent: useMatch(APP_PATH.recent),
},
{
title: translate('top-comic-title'),
Expand Down
1 change: 0 additions & 1 deletion src/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const Pagination = ({ page, totalPage, queryConfig }: PaginationProps) => {
const RANGE = 2;
const lang = useAppSelector((state) => selectLanguage(state.settings));
const translate = useTranslation(lang);
if (totalPage <= 1) return <></>;

const _renderPagination = () => {
let dotAfter = false;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Preview/ListPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface ListPreviewProps {

const ListPreview = ({ data, className }: ListPreviewProps) => {
return (
<ul className={className || 'mt-5 grid grid-cols-3 gap-3 gap-y-5 sm:grid-cols-4 md:grid-cols-5'}>
<ul className={className || 'mt-5 grid grid-cols-3 gap-3 gap-y-5 sm:grid-cols-4 md:grid-cols-4'}>
{data &&
data.map((item) => (
<li key={item._id}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Preview/TopPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const TopPreview = ({ data, top = 7 }: TopPreviewProps) => {
<Link
title={item.name}
to={`${APP_PATH.comics}/${item._id}`}
className="text-base font-semibold leading-4 text-black hover:text-primary dark:text-white dark:hover:text-primary">
className="line-clamp-2 text-base font-semibold leading-4 text-black hover:text-primary dark:text-white dark:hover:text-primary">
{item.name}
</Link>
<p className="ml-[1px] line-clamp-1 text-sm leading-5 text-gray-400">
Expand Down
19 changes: 14 additions & 5 deletions src/constants/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const COOKIE_KEYS = {

export const ROLES = {
admin: 1,
collaborators: 2,
};

export const ROLE_LIST = [
Expand All @@ -38,6 +39,10 @@ export const ROLE_LIST = [
value: 1,
name: 'admin',
},
{
value: 2,
name: 'collaborators',
},
];

export const COMIC_TYPES_LIST = [
Expand Down Expand Up @@ -74,16 +79,20 @@ export const FILTER_OPTIONS = [
name: 'All',
value: 0,
},
{
name: '1 Year',
value: 12,
},
{
name: '3 Months',
value: 3,
value: 3 * 30,
},
{
name: '1 Month',
value: 30,
},
{
name: '1 Week',
value: 7,
},
{
name: '1 Day',
value: 1,
},
];
Expand Down
Loading

0 comments on commit 03c30f3

Please sign in to comment.