mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-03 21:15:35 +05:00
feat: all collections search
Some checks failed
Build and Publish 'anix-api-prox' to Docker Hub / publish (push) Has been cancelled
Build and Publish 'anix' to Docker Hub / publish (push) Has been cancelled
Some checks failed
Build and Publish 'anix-api-prox' to Docker Hub / publish (push) Has been cancelled
Build and Publish 'anix' to Docker Hub / publish (push) Has been cancelled
This commit is contained in:
parent
42d6874cb4
commit
be0731cfba
4 changed files with 24 additions and 8 deletions
|
@ -58,6 +58,7 @@ export const ENDPOINTS = {
|
|||
profileFavorites: `${API_PREFIX}/search/favorites`,
|
||||
profiles: `${API_PREFIX}/search/profiles`,
|
||||
releases: `${API_PREFIX}/search/releases`,
|
||||
collections: `${API_PREFIX}/search/collections`,
|
||||
},
|
||||
statistic: {
|
||||
addHistory: `${API_PREFIX}/history/add`,
|
||||
|
|
|
@ -28,10 +28,12 @@ export const CollectionLink = (props: any) => {
|
|||
icon_name="material-symbols--favorite"
|
||||
name_2={props.favorites_count}
|
||||
/>
|
||||
<Chip
|
||||
icon_name="material-symbols--comment"
|
||||
name_2={props.comment_count}
|
||||
/>
|
||||
{props.comment_count && (
|
||||
<Chip
|
||||
icon_name="material-symbols--comment"
|
||||
name_2={props.comment_count}
|
||||
/>
|
||||
)}
|
||||
{props.is_private && (
|
||||
<div className="flex items-center justify-center bg-yellow-400 rounded-sm">
|
||||
<span className="w-3 px-4 py-2.5 text-white sm:px-4 sm:py-3 xl:px-6 xl:py-4 iconify mdi--lock"></span>
|
||||
|
|
|
@ -61,8 +61,13 @@ const whereMapping = [
|
|||
auth: true,
|
||||
},
|
||||
{
|
||||
id: "collections",
|
||||
label: "Коллекциях",
|
||||
id: "collections_all",
|
||||
label: "Всех Коллекциях",
|
||||
auth: false,
|
||||
},
|
||||
{
|
||||
id: "collections_fav",
|
||||
label: "Своих Коллекциях",
|
||||
auth: true,
|
||||
},
|
||||
];
|
||||
|
@ -179,6 +184,7 @@ export function SearchPage() {
|
|||
url.searchParams.set("query", query);
|
||||
url.searchParams.set("params", JSON.stringify(params));
|
||||
router.replace(url.toString());
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [query]);
|
||||
|
||||
const getKey = (pageIndex: number, previousPageData: any) => {
|
||||
|
@ -214,7 +220,10 @@ export function SearchPage() {
|
|||
case "favorites":
|
||||
url = `${ENDPOINTS.search.profileFavorites}/${pageIndex}`;
|
||||
break;
|
||||
case "collections":
|
||||
case "collections_all":
|
||||
url = `${ENDPOINTS.search.collections}/${pageIndex}`;
|
||||
break;
|
||||
case "collections_fav":
|
||||
url = `${ENDPOINTS.search.profileFavoriteCollection}/${pageIndex}`;
|
||||
break;
|
||||
}
|
||||
|
@ -385,7 +394,7 @@ export function SearchPage() {
|
|||
content.length > 0 ?
|
||||
params.where == "profiles" ?
|
||||
<UserSection content={content} />
|
||||
: params.where == "collections" ?
|
||||
: ["collections_all", "collections_fav"].includes(params.where) ?
|
||||
<CollectionsSection content={content} />
|
||||
: <ReleaseSection content={content} />
|
||||
: <div className="flex flex-col items-center justify-center min-w-full gap-4 mt-12 text-xl">
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
# 3.8.0
|
||||
|
||||
## Добавлено
|
||||
|
||||
- Поиск среди всех коллекций
|
||||
|
||||
## Изменено
|
||||
|
||||
- Фильтры на странице поиска были перемещены рядом с полем ввода
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue