UNPKG

fui-fancyui

Version:
23 lines (22 loc) 709 B
import { create as l } from "../../../../node_modules/zustand/esm/react.js"; function r() { return l((t) => ({ // the state array for the modals modals: [], // add a new modal to the state array openSwipeUpModal: (a, e, o) => t((s) => ({ modals: [...s.modals, { children: e, id: a, status: "open", config: o }] })), // change the status of the modal to closing closeSwipeUpModal: (a) => { t((e) => ({ modals: e.modals.map((o) => o.id === a ? { ...o, status: "closing" } : o) })), setTimeout(() => { t((e) => ({ modals: e.modals.filter((o) => o.id !== a) })); }, 300); } })); } export { r as createFancySwipeUpModalStore };