diff --git a/app/package.json b/app/package.json
index 887cf96..50be095 100644
--- a/app/package.json
+++ b/app/package.json
@@ -13,6 +13,7 @@
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
+ "little-state-machine": "^2.11.3",
"lodash": "^4.17.15",
"react": "^16.12.0",
"react-dom": "^16.12.0",
diff --git a/app/src/devTool/devTool.tsx b/app/src/devTool/devTool.tsx
index 243631a..0ccc18a 100644
--- a/app/src/devTool/devTool.tsx
+++ b/app/src/devTool/devTool.tsx
@@ -1,76 +1,26 @@
import * as React from 'react';
+import {
+ StateMachineProvider,
+ createStore,
+ setStorageType,
+} from 'little-state-machine';
import { Control } from 'react-hook-form';
-import { Animate } from 'react-simple-animate';
-import Header from './header';
-import Panel from './panel';
-import colors from './colors';
-import Logo from './logo';
-import { PanelShadow } from './panelShadow';
-import { Button } from './styled';
+import { DevToolUI } from './devToolUI';
-export const DevTool = ({ control }: { control: Control }) => {
- const [visible, setVisible] = React.useState(true);
+setStorageType(window.localStorage);
- return (
- <>
-
-
-
-
+createStore({
+ visible: true,
+ isCollapse: false,
+ filterName: '',
+}, {
+ name: "__REACT_HOOK_FORM_DEVTOOLS__"
+});
- {!visible && (
-
- )}
- >
+export const DevTool = ({ control }: { control: Control }) => {
+ return (
+
+
+
);
};
diff --git a/app/src/devTool/devToolUI.tsx b/app/src/devTool/devToolUI.tsx
new file mode 100644
index 0000000..e7591b1
--- /dev/null
+++ b/app/src/devTool/devToolUI.tsx
@@ -0,0 +1,78 @@
+import * as React from 'react';
+import { Control } from 'react-hook-form';
+import { Animate } from 'react-simple-animate';
+import Header from './header';
+import Panel from './panel';
+import colors from './colors';
+import Logo from './logo';
+import { PanelShadow } from './panelShadow';
+import { Button } from './styled';
+import { useStateMachine } from 'little-state-machine';
+import { setVisible } from './settingAction';
+
+export const DevToolUI = ({ control }: { control: Control }) => {
+ const { state, action } = useStateMachine(setVisible);
+
+ return (
+ <>
+
+
+
+
+
+ {!state.visible && (
+
+ )}
+ >
+ );
+};
diff --git a/app/src/devTool/header.tsx b/app/src/devTool/header.tsx
index 42f8b22..d53f812 100644
--- a/app/src/devTool/header.tsx
+++ b/app/src/devTool/header.tsx
@@ -4,7 +4,7 @@ import { Control } from 'react-hook-form';
import { CircleButton, paraGraphDefaultStyle } from './styled';
type Props = {
- setVisible: (visible: boolean) => void;
+ setVisible: any;
control: Control;
};
diff --git a/app/src/devTool/logo.tsx b/app/src/devTool/logo.tsx
index 03e6fa8..f0f3fc4 100644
--- a/app/src/devTool/logo.tsx
+++ b/app/src/devTool/logo.tsx
@@ -6,7 +6,7 @@ const Logo = ({
setVisible,
}: {
style?: Record;
- setVisible: (visible: boolean) => void;
+ setVisible: any;
}) => {
return (