mirror of
https://github.com/D4M13N-D3V/neroshitron.git
synced 2025-03-14 10:05:04 +00:00
* fix: navigation bar code is minimized, started seperating out components and refactoring them * feat: search components * Update search.tsx * fix: autofocus * fix: tags and search
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
"use client;"
|
|
import React, { useState, useEffect } from 'react';
|
|
import SearchInput from '@/components/neroshitron/search_input';
|
|
import Galleries from './galleries';
|
|
|
|
interface SearchProps { }
|
|
|
|
const Search = ({ }:SearchProps) => {
|
|
const [tags, setTags] = useState<string[]>([]);
|
|
const [search, setSearch] = useState<string>('');
|
|
const [nsfw, setNsfw] = useState<boolean>(false);
|
|
|
|
const getData = async () => {
|
|
}
|
|
|
|
useEffect(() => {
|
|
getData();
|
|
}, [search]);
|
|
useEffect(() => {
|
|
getData();
|
|
}, [nsfw]);
|
|
useEffect(() => {
|
|
getData();
|
|
}, [tags]);
|
|
useEffect(() => {
|
|
getData();
|
|
}, []);
|
|
|
|
return (
|
|
<>
|
|
<Galleries 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 searchChanged={(search)=>{setSearch(search)}} nsfwChanged={(nsfw)=>{setNsfw(nsfw)}} tagsChanged={(tags)=>{setTags(tags);}} />
|
|
</div>
|
|
|
|
</section>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default Search; |