feat(headerComponent): add support for storeStore in headerComponent to manage store state
refactor(headerComponent): refactor useDarkStore calls in headerComponent to improve readability and maintainability
This commit is contained in:
parent
97d7f330ea
commit
68e5454b11
1 changed files with 7 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ import { AuthContext } from "../../contexts/authContext";
|
|||
|
||||
import { FlowsContext } from "../../contexts/flowsContext";
|
||||
import { useDarkStore } from "../../stores/darkStore";
|
||||
import { useStoreStore } from "../../stores/storeStore";
|
||||
import { gradients } from "../../utils/styleUtils";
|
||||
import IconComponent from "../genericIconComponent";
|
||||
import { Button } from "../ui/button";
|
||||
|
|
@ -29,7 +30,12 @@ export default function Header(): JSX.Element {
|
|||
const { logout, autoLogin, isAdmin, userData } = useContext(AuthContext);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { dark, setDark, stars, gradientIndex } = useDarkStore();
|
||||
const hasStore = useStoreStore((state) => state.hasStore);
|
||||
|
||||
const dark = useDarkStore((state) => state.dark);
|
||||
const setDark = useDarkStore((state) => state.setDark);
|
||||
const stars = useDarkStore((state) => state.stars);
|
||||
const gradientIndex = useDarkStore((state) => state.gradientIndex);
|
||||
|
||||
useEffect(() => {
|
||||
if (dark) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue