Skip to content

Commit

Permalink
new hooks for search modal
Browse files Browse the repository at this point in the history
  • Loading branch information
ocitocit committed Oct 16, 2023
1 parent c1133cd commit d633541
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions hooks/useSearchModal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { create } from 'zustand';

interface SearchModalStore {
isOpen: boolean;
onOpen: () => void;
onClose: () => void;
}

const useSearchModal = create<SearchModalStore>((set) => ({
isOpen: false,
onOpen: () => set({ isOpen: true }),
onClose: () => set({ isOpen: false })
}));

export default useSearchModal;

0 comments on commit d633541

Please sign in to comment.