refactor(app): replace recoil with zustand

This commit is contained in:
rektdeckard
2025-05-17 15:16:55 -06:00
committed by Tobias Fried
parent 7f613234e5
commit ef83bdfb37
30 changed files with 539 additions and 594 deletions

View File

@@ -1,7 +1,7 @@
import React, { useCallback } from "react";
import { useRecoilState } from "recoil";
import { useShallow } from "zustand/react/shallow";
import { iconSizeAtom } from "@/state";
import { useApplicationStore } from "@/state";
import "./SizeInput.css";
type SizeInputProps = {};
@@ -15,7 +15,10 @@ const handleBlur = (event: React.UIEvent<HTMLInputElement>) => {
};
const SizeInput = (_: SizeInputProps) => {
const [size, setSize] = useRecoilState(iconSizeAtom);
const { size, setSize } = useApplicationStore(useShallow((state) => ({
size: state.iconSize,
setSize: state.setIconSize,
})));
const handleSizeChange = useCallback(
(event: React.ChangeEvent<HTMLInputElement>) => {