diff --git a/src/features/setting/Container.tsx b/src/features/setting/Container.tsx index 822853b..530abf1 100644 --- a/src/features/setting/Container.tsx +++ b/src/features/setting/Container.tsx @@ -3,6 +3,7 @@ import { useLayoutEffect } from 'react'; import { bottomBtnAtom, titleAtom } from '../shared/layout/atom'; +import useSetting from './hooks/useSetting'; import './style/index.scss'; import PreviewSection from './components/PreviewSection'; import SubmitForm from './components/SubmitForm'; @@ -10,6 +11,10 @@ import SubmitForm from './components/SubmitForm'; const Container = () => { const [, setTitle] = useAtom(titleAtom); const [, setBottomBtn] = useAtom(bottomBtnAtom); + + const { handlePreviewClick, handleSubmit, onSubmit, register, control } = + useSetting(); + useLayoutEffect(() => { setTitle({ title: 'Active', back: true }); setBottomBtn({ text: 'Save' }); @@ -17,8 +22,13 @@ const Container = () => { return (
- - + +
); }; diff --git a/src/features/setting/components/PreviewSection.tsx b/src/features/setting/components/PreviewSection.tsx index d9fd707..3ae1db0 100644 --- a/src/features/setting/components/PreviewSection.tsx +++ b/src/features/setting/components/PreviewSection.tsx @@ -1,8 +1,14 @@ +import { FunctionComponent } from 'react'; + import { previewSubText, previewTitleText } from '../constants'; -import useSetting from '../hooks/useSetting'; -const PreviewSection = () => { - const { handlePreviewClick } = useSetting(); +type PreviewSectionProps = { + handlePreviewClick: () => void; +}; + +const PreviewSection: FunctionComponent = ({ + handlePreviewClick, +}) => { return (
{previewTitleText}
diff --git a/src/features/setting/components/SubmitForm/DailySticker.tsx b/src/features/setting/components/SubmitForm/DailySticker.tsx index aa38cd1..29614e7 100644 --- a/src/features/setting/components/SubmitForm/DailySticker.tsx +++ b/src/features/setting/components/SubmitForm/DailySticker.tsx @@ -1,13 +1,17 @@ +import { FunctionComponent } from 'react'; import { Controller } from 'react-hook-form'; +import { Control } from 'react-hook-form'; +import { Inputs } from '../../types'; import { stickerList, wordStickerText } from '../../constants'; -import useSetting from '../../hooks/useSetting'; import '../../style/index.scss'; -const DailySticker = () => { - const { control } = useSetting(); +type DailyStickerProps = { + control: Control; +}; +const DailySticker: FunctionComponent = ({ control }) => { return (
{wordStickerText} @@ -18,7 +22,11 @@ const DailySticker = () => { render={({ field }) => (
{stickerList.map((sticker) => ( -