mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-30 18:09:40 +05:00
chore: migrate to new flowbite-react
This commit is contained in:
parent
8daab3b3c1
commit
329448c9fc
32 changed files with 650 additions and 344 deletions
|
@ -5,7 +5,7 @@ import { Spinner } from "#/components/Spinner/Spinner";
|
|||
import { useState, useEffect } from "react";
|
||||
import { useScrollPosition } from "#/hooks/useScrollPosition";
|
||||
import { useUserStore } from "../store/auth";
|
||||
import { Dropdown, Button } from "flowbite-react";
|
||||
import { Button, ButtonGroup, Dropdown, DropdownItem } from "flowbite-react";
|
||||
import { sort } from "./common";
|
||||
import { ENDPOINTS } from "#/api/config";
|
||||
import { BookmarksList, useSWRfetcher } from "#/api/utils";
|
||||
|
@ -151,7 +151,7 @@ export function BookmarksCategoryPage(props: any) {
|
|||
</form>
|
||||
: ""}
|
||||
<div className="m-4 overflow-auto">
|
||||
<Button.Group>
|
||||
<ButtonGroup>
|
||||
<Button
|
||||
className="whitespace-nowrap"
|
||||
disabled={props.slug == "watching"}
|
||||
|
@ -222,7 +222,7 @@ export function BookmarksCategoryPage(props: any) {
|
|||
>
|
||||
{props.SectionTitleMapping["abandoned"]}
|
||||
</Button>
|
||||
</Button.Group>
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
<div className="flex items-center justify-between px-4 py-2 border-b-2 border-black dark:border-white">
|
||||
<h1 className="font-bold text-md sm:text-xl md:text-lg xl:text-xl">
|
||||
|
@ -237,7 +237,7 @@ export function BookmarksCategoryPage(props: any) {
|
|||
theme={DropdownTheme}
|
||||
>
|
||||
{sort.values.map((item, index) => (
|
||||
<Dropdown.Item key={index} onClick={() => setSelectedSort(index)}>
|
||||
<DropdownItem key={index} onClick={() => setSelectedSort(index)}>
|
||||
<span
|
||||
className={`w-6 h-6 iconify ${
|
||||
sort.values[index].value.split("_")[1] == "descending" ?
|
||||
|
@ -246,7 +246,7 @@ export function BookmarksCategoryPage(props: any) {
|
|||
}`}
|
||||
></span>
|
||||
{item.name}
|
||||
</Dropdown.Item>
|
||||
</DropdownItem>
|
||||
))}
|
||||
</Dropdown>
|
||||
</div>
|
||||
|
|
|
@ -5,14 +5,15 @@ import { useEffect, useState, useCallback } from "react";
|
|||
import { useSearchParams, useRouter } from "next/navigation";
|
||||
import { ENDPOINTS } from "#/api/config";
|
||||
import {
|
||||
Card,
|
||||
Button,
|
||||
Card,
|
||||
Checkbox,
|
||||
TextInput,
|
||||
Textarea,
|
||||
FileInput,
|
||||
Label,
|
||||
Modal,
|
||||
ModalHeader,
|
||||
Textarea,
|
||||
TextInput,
|
||||
useThemeMode,
|
||||
} from "flowbite-react";
|
||||
import { PosterWithStuff } from "#/components/ReleasePoster/PosterWithStuff";
|
||||
|
@ -388,10 +389,9 @@ export const CreateCollectionPage = () => {
|
|||
</Label>
|
||||
<div className="flex-1">
|
||||
<div className="block mb-2">
|
||||
<Label
|
||||
htmlFor="title"
|
||||
value="Название (минимум 10, максимум 60 символов)"
|
||||
/>
|
||||
<Label htmlFor="title">
|
||||
Название (минимум 10, максимум 60 символов)
|
||||
</Label>
|
||||
</div>
|
||||
<TextInput
|
||||
id="title"
|
||||
|
@ -408,10 +408,9 @@ export const CreateCollectionPage = () => {
|
|||
{stringLength.title}/60
|
||||
</p>
|
||||
<div className="block mt-2 mb-2">
|
||||
<Label
|
||||
htmlFor="description"
|
||||
value="Описание (максимум 1000 символов)"
|
||||
/>
|
||||
<Label htmlFor="description">
|
||||
Описание (максимум 1000 символов)
|
||||
</Label>
|
||||
</div>
|
||||
<Textarea
|
||||
rows={4}
|
||||
|
@ -434,7 +433,7 @@ export const CreateCollectionPage = () => {
|
|||
checked={isPrivate}
|
||||
onChange={(e) => setIsPrivate(e.target.checked)}
|
||||
/>
|
||||
<Label htmlFor="private" value="Приватная коллекция" />
|
||||
<Label htmlFor="private">Приватная коллекция</Label>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
|
@ -603,7 +602,7 @@ export const ReleasesEditModal = (props: {
|
|||
onClose={() => props.setIsOpen(false)}
|
||||
size={"7xl"}
|
||||
>
|
||||
<Modal.Header>Изменить релизы в коллекции</Modal.Header>
|
||||
<ModalHeader>Изменить релизы в коллекции</ModalHeader>
|
||||
<div
|
||||
onScroll={handleScroll}
|
||||
ref={modalRef}
|
||||
|
|
|
@ -5,7 +5,7 @@ import { Spinner } from "#/components/Spinner/Spinner";
|
|||
import { useState, useEffect } from "react";
|
||||
import { useScrollPosition } from "#/hooks/useScrollPosition";
|
||||
import { useUserStore } from "../store/auth";
|
||||
import { Dropdown, Button } from "flowbite-react";
|
||||
import { Button, Dropdown, DropdownItem } from "flowbite-react";
|
||||
import { sort } from "./common";
|
||||
import { ENDPOINTS } from "#/api/config";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
@ -126,7 +126,7 @@ export function FavoritesPage() {
|
|||
theme={DropdownTheme}
|
||||
>
|
||||
{sort.values.map((item, index) => (
|
||||
<Dropdown.Item key={index} onClick={() => setSelectedSort(index)}>
|
||||
<DropdownItem key={index} onClick={() => setSelectedSort(index)}>
|
||||
<span
|
||||
className={`w-6 h-6 iconify ${
|
||||
sort.values[index].value.split("_")[1] == "descending"
|
||||
|
@ -135,7 +135,7 @@ export function FavoritesPage() {
|
|||
}`}
|
||||
></span>
|
||||
{item.name}
|
||||
</Dropdown.Item>
|
||||
</DropdownItem>
|
||||
))}
|
||||
</Dropdown>
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,7 @@ import { useState, useEffect } from "react";
|
|||
import { useScrollPosition } from "#/hooks/useScrollPosition";
|
||||
import { useUserStore } from "../store/auth";
|
||||
import { _FetchHomePageReleases } from "#/api/utils";
|
||||
import { Button } from "flowbite-react";
|
||||
import { Button, ButtonGroup } from "flowbite-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export function IndexCategoryPage(props) {
|
||||
|
@ -53,13 +53,13 @@ export function IndexCategoryPage(props) {
|
|||
return (
|
||||
<>
|
||||
<div className="mb-4 overflow-auto">
|
||||
<Button.Group>
|
||||
<ButtonGroup>
|
||||
<Button className="whitespace-nowrap" disabled={props.slug == "last"} color="light" onClick={() => router.push("/home/last")}>{props.SectionTitleMapping["last"]}</Button>
|
||||
<Button className="whitespace-nowrap" disabled={props.slug == "finished"} color="light" onClick={() => router.push("/home/finished")}>{props.SectionTitleMapping["finished"]}</Button>
|
||||
<Button className="whitespace-nowrap" disabled={props.slug == "ongoing"} color="light" onClick={() => router.push("/home/ongoing")}>{props.SectionTitleMapping["ongoing"]}</Button>
|
||||
<Button className="whitespace-nowrap" disabled={props.slug == "announce"} color="light" onClick={() => router.push("/home/announce")}>{props.SectionTitleMapping["announce"]}</Button>
|
||||
<Button className="whitespace-nowrap" disabled={props.slug == "films"} color="light" onClick={() => router.push("/home/films")}>{props.SectionTitleMapping["films"]}</Button>
|
||||
</Button.Group>
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
{content && content.length > 0 ? (
|
||||
<ReleaseSection
|
||||
|
|
|
@ -8,7 +8,7 @@ import { useScrollPosition } from "#/hooks/useScrollPosition";
|
|||
import { useRouter } from "next/navigation";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import { useUserStore } from "../store/auth";
|
||||
import { Button, Dropdown, Modal } from "flowbite-react";
|
||||
import { Button, Dropdown, DropdownItem, Modal, ModalBody, ModalFooter, ModalHeader } from "flowbite-react";
|
||||
import { CollectionsSection } from "#/components/CollectionsSection/CollectionsSection";
|
||||
import { UserSection } from "#/components/UserSection/UserSection";
|
||||
import { useSWRfetcher } from "#/api/utils";
|
||||
|
@ -360,8 +360,8 @@ const FiltersModal = (props: {
|
|||
|
||||
return (
|
||||
<Modal show={props.isOpen} onClose={() => _cancel()}>
|
||||
<Modal.Header>Фильтры</Modal.Header>
|
||||
<Modal.Body>
|
||||
<ModalHeader>Фильтры</ModalHeader>
|
||||
<ModalBody>
|
||||
<div className="my-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<p className="font-bold dark:text-white">Искать в</p>
|
||||
|
@ -376,12 +376,12 @@ const FiltersModal = (props: {
|
|||
return <></>;
|
||||
} else {
|
||||
return (
|
||||
<Dropdown.Item
|
||||
<DropdownItem
|
||||
onClick={() => setWhere(item)}
|
||||
key={`where--${item}`}
|
||||
>
|
||||
{WhereMapping[item]}
|
||||
</Dropdown.Item>
|
||||
</DropdownItem>
|
||||
);
|
||||
}
|
||||
})}
|
||||
|
@ -395,12 +395,12 @@ const FiltersModal = (props: {
|
|||
<Dropdown label={ListsMapping[list].name} color="blue">
|
||||
{Object.keys(ListsMapping).map((item) => {
|
||||
return (
|
||||
<Dropdown.Item
|
||||
<DropdownItem
|
||||
onClick={() => setList(item)}
|
||||
key={`list--${item}`}
|
||||
>
|
||||
{ListsMapping[item].name}
|
||||
</Dropdown.Item>
|
||||
</DropdownItem>
|
||||
);
|
||||
})}
|
||||
</Dropdown>
|
||||
|
@ -414,20 +414,20 @@ const FiltersModal = (props: {
|
|||
<Dropdown label={TagMapping[searchBy].name} color="blue">
|
||||
{Object.keys(TagMapping).map((item) => {
|
||||
return (
|
||||
<Dropdown.Item
|
||||
<DropdownItem
|
||||
onClick={() => setSearchBy(item)}
|
||||
key={`tag--${item}`}
|
||||
>
|
||||
{TagMapping[item].name}
|
||||
</Dropdown.Item>
|
||||
</DropdownItem>
|
||||
);
|
||||
})}
|
||||
</Dropdown>
|
||||
</div>
|
||||
</div>
|
||||
: ""}
|
||||
</Modal.Body>
|
||||
<Modal.Footer>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<div className="flex justify-end w-full gap-2">
|
||||
<Button color="red" onClick={() => _cancel()}>
|
||||
Отменить
|
||||
|
@ -436,7 +436,7 @@ const FiltersModal = (props: {
|
|||
Применить
|
||||
</Button>
|
||||
</div>
|
||||
</Modal.Footer>
|
||||
</ModalFooter>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue