mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Separate DirectoryModal (for home view placeholders) and CreateBoardModal (for board view create button) into distinct components with their own stores, allowing independent styling and cleaner separation of concerns.
26 lines
453 B
TypeScript
26 lines
453 B
TypeScript
import { create } from 'zustand';
|
|
|
|
interface DirectoryModalState {
|
|
showModal: boolean;
|
|
openDirectoryModal: () => void;
|
|
closeDirectoryModal: () => void;
|
|
}
|
|
|
|
const useDirectoryModalStore = create<DirectoryModalState>((set) => ({
|
|
showModal: false,
|
|
|
|
openDirectoryModal: () => {
|
|
set({
|
|
showModal: true,
|
|
});
|
|
},
|
|
|
|
closeDirectoryModal: () => {
|
|
set({
|
|
showModal: false,
|
|
});
|
|
},
|
|
}));
|
|
|
|
export default useDirectoryModalStore;
|