diff --git a/src/components/header/index.tsx b/src/components/header/index.tsx index 278c925..0e35247 100644 --- a/src/components/header/index.tsx +++ b/src/components/header/index.tsx @@ -1,9 +1,5 @@ import Logo from '@components/logo'; import Container from './index.style'; -import { useRecoilState } from 'recoil'; -import { selectedPatternIdState } from '@context/pattern'; -import { selectedWheelIdState } from '@context/wheel'; -import { useEffect } from 'react'; import { useNavigate } from 'react-router'; interface HeaderProps { @@ -12,13 +8,6 @@ interface HeaderProps { function Header(props: HeaderProps) { const navigate = useNavigate(); - const [, setSelectedPattern] = useRecoilState(selectedPatternIdState); - const [, setSelectedWheel] = useRecoilState(selectedWheelIdState); - - useEffect(() => { - setSelectedPattern(0); - setSelectedWheel(0); - }, []); return ( diff --git a/src/context/accessory.ts b/src/context/accessory.ts new file mode 100644 index 0000000..07488fe --- /dev/null +++ b/src/context/accessory.ts @@ -0,0 +1,6 @@ +import { atom } from 'recoil'; + +export const selectedAccessoryState = atom({ + key: 'selectedAccessoryState', + default: 0, +}); diff --git a/src/context/color.ts b/src/context/color.ts index ea1889e..f92e155 100644 --- a/src/context/color.ts +++ b/src/context/color.ts @@ -1,6 +1,6 @@ import { atom } from 'recoil'; -export const selectedColorIdState = atom({ +export const selectedColorState = atom({ key: 'selectedColorIdState', default: 0, }); diff --git a/src/context/font.ts b/src/context/font.ts index a3268a2..8bb8e40 100644 --- a/src/context/font.ts +++ b/src/context/font.ts @@ -1,6 +1,6 @@ import { atom } from 'recoil'; -export const selectedFontIdState = atom({ +export const selectedFontState = atom({ key: 'selectedFontIdState', default: 0, }); diff --git a/src/context/pattern.ts b/src/context/pattern.ts index 010d9d9..6acb9a4 100644 --- a/src/context/pattern.ts +++ b/src/context/pattern.ts @@ -1,6 +1,6 @@ import { atom } from 'recoil'; -export const selectedPatternIdState = atom({ +export const selectedPatternState = atom({ key: 'selectedPatternState', default: 0, }); diff --git a/src/context/wheel.ts b/src/context/wheel.ts index 2c29169..6965894 100644 --- a/src/context/wheel.ts +++ b/src/context/wheel.ts @@ -1,6 +1,6 @@ import { atom } from 'recoil'; -export const selectedWheelIdState = atom({ +export const selectedWheelState = atom({ key: 'selectedWheelIdState', default: 0, }); diff --git a/src/pages/production/button-group/index.tsx b/src/pages/production/button-group/index.tsx index 209ee20..737e00a 100644 --- a/src/pages/production/button-group/index.tsx +++ b/src/pages/production/button-group/index.tsx @@ -20,7 +20,7 @@ function ButtonGroup(props: ButtonGroupProps) {