fix: create page

This commit is contained in:
Damien Ostler 2024-06-02 03:51:53 -04:00
parent 2c59660566
commit 894fb58c29
5 changed files with 17 additions and 7 deletions

View File

@ -60,6 +60,9 @@ function PageComponent() {
<div className="w-full flex">
<div className="w-1/2 mr-2">
<SearchInput
placeholderTags={[
{ value: "tags", label: "❗️ click here to add tags" },
]}
nsfwButtonEnabled={false}
searchChanged={(search) => {}}
nsfwChanged={(nsfw) => {}}

View File

@ -60,6 +60,9 @@ function PageComponent() {
<div className="w-full flex">
<div className="w-1/2">
<SearchInput
placeholderTags={[
{ value: "tags", label: "❗️ click here to add tags" },
]}
nsfwButtonEnabled={false}
searchChanged={(search) => {}}
nsfwChanged={(nsfw) => {}}

View File

@ -58,8 +58,11 @@ function PageComponent() {
</div>
</div>
<div className="w-full flex">
<div className="w-1/2 pr-1">
<div className="w-1/2">
<SearchInput
placeholderTags={[
{ value: "tags", label: "❗️ click here to add tags" },
]}
nsfwButtonEnabled={false}
searchChanged={(search) => {}}
nsfwChanged={(nsfw) => {}}

View File

@ -44,7 +44,10 @@ const Search = ({ gallerySelected }: SearchProps) => {
<Galleries gallerySelected={(gallery: string) => { setGallery(gallery) }} key={search + "-" + tags.length + "-" + nsfw} search={search} nsfw={nsfw} tags={tags} />
<section className="fixed flex items-center w-full p-8 pt-20 opacity-90 animate-in animate-once animate-duration-500">
<div className="container mx-auto py-8">
<SearchInput nsfwButtonDisabled={true} searchChanged={(search) => { setSearch(search) }} nsfwChanged={(nsfw) => { setNsfw(nsfw) }} tagsChanged={(tags) => { setTags(tags); }} />
<SearchInput placeholderTags={[
{ value: "neroshi", label: "🧑‍🎨 neroshi" },
{ value: "neroshi", label: "❗️ click here for tags!" },
]} nsfwButtonEnabled={true} searchChanged={(search) => { setSearch(search) }} nsfwChanged={(nsfw) => { setNsfw(nsfw) }} tagsChanged={(tags) => { setTags(tags); }} />
</div>
</section>
</>

View File

@ -10,17 +10,15 @@ interface SearchInputProps {
searchChanged: (search: string) => void;
nsfwChanged: (nsfw: boolean) => void;
nsfwButtonEnabled: boolean | null;
placeholderTags: Option[];
}
const SearchInput = ({ tagsChanged, searchChanged, nsfwChanged, nsfwButtonEnabled }: SearchInputProps) => {
const SearchInput = ({ tagsChanged, searchChanged, nsfwChanged, nsfwButtonEnabled, placeholderTags }: SearchInputProps) => {
const [tagSearch, setTagSearch] = useState<string>('');
const [nsfw, setNsfw] = useState<boolean>(false);
const [selectedTags, setSelectedTags] = useState<string[]>([]);
const [selectedTagsInput, setSelectedTagsInput] = useState<Option[]>([
{ value: "neroshi", label: "🧑‍🎨 neroshi" },
{ value: "neroshi", label: "❗️ click here for tags!" },
]);
const [selectedTagsInput, setSelectedTagsInput] = useState<Option[]>(placeholderTags);
const [selectingTags, setSelectingTags] = useState<boolean>(false);
const tagSelectorRef = React.useRef(null);
const [tags, setTags] = useState<any[]>([]);