diff --git a/src/hooks/signUpSteps.ts b/src/hooks/signUpSteps.ts index 41f87d9..3c9cb27 100755 --- a/src/hooks/signUpSteps.ts +++ b/src/hooks/signUpSteps.ts @@ -1,17 +1,18 @@ -import { signUpStep } from '@/store/signUp'; +import { stepIndex } from '@/store/common'; import { ReactElement } from 'react'; import { useNavigate } from 'react-router-dom'; import { useRecoilState } from 'recoil'; export function useSignUpStepForm(steps: ReactElement[]) { - const [currentStepIndex, setCurrentStepIndex] = useRecoilState(signUpStep); + const [currentStepIndex, setCurrentStepIndex] = useRecoilState(stepIndex); const navigate = useNavigate(); /** * handle next button */ function handleNextButton() { + const currIdx = currentStepIndex; setCurrentStepIndex(() => (currIdx < steps.length - 1) ? (currIdx + 1) : currIdx); } diff --git a/src/pages/auth/resetPW/ResetPWMode.tsx b/src/pages/auth/resetPW/ResetPWMode.tsx index f3e615d..06ebb7e 100644 --- a/src/pages/auth/resetPW/ResetPWMode.tsx +++ b/src/pages/auth/resetPW/ResetPWMode.tsx @@ -1,12 +1,14 @@ +import { currentFormType, stepButtonProps } from '@/store/common'; import { resetPWMode, resetPWNextButtonState } from '@/store/resetPW'; import { Button, Container } from '@mui/material'; import Typography from '@mui/material/Typography'; import { useEffect } from 'react'; -import { useRecoilState } from 'recoil'; +import { useRecoilState, useSetRecoilState } from 'recoil'; const ResetPWMode = (props: any) => { - const [nextButtonProps, setNextButtonProps] = useRecoilState(resetPWNextButtonState); + const [nextButtonProps, setNextButtonProps] = useRecoilState(stepButtonProps); const [pWChgMode, setPWChgMode] = useRecoilState(resetPWMode); + const setStepType = useSetRecoilState(currentFormType); const getSelectModeButton = ( text: string, @@ -44,8 +46,10 @@ const ResetPWMode = (props: any) => { }; useEffect(() => { + setStepType('RESETPW'); setNextButtonProps({ ...nextButtonProps, + text: '다음', isDisabled: false, clickHandler: props.handleNextButton, }); diff --git a/src/pages/settings/SettingsPage.tsx b/src/pages/settings/SettingsPage.tsx index a2dda27..080bfcd 100644 --- a/src/pages/settings/SettingsPage.tsx +++ b/src/pages/settings/SettingsPage.tsx @@ -2,35 +2,26 @@ import { Box, Button, - Container, - Fade, - Icon, - List, + Container, List, ListItemButton, ListItemText, ListSubheader, - Typography, + Typography } from '@mui/material'; import React, { useEffect } from 'react'; import ChevronRightIcon from '@mui/icons-material/ChevronRight'; -import Spacer from '@/components/common/Spacer'; import ListIcon from '@/components/settings/ListIcon'; import UserAvatar from '@/components/settings/UserAvatar'; import { stepIndex } from '@/store/common'; -import { resetPWCompletePopupShow } from '@/store/resetPW'; import { useNavigate } from 'react-router-dom'; -import { useRecoilState, useSetRecoilState } from 'recoil'; +import { useSetRecoilState } from 'recoil'; import SettingWrapper from '../auth/common/Wrapper'; const SettingPage = () => { const navigation = useNavigate(); - const [completePopupShow, setCompletePopupShow] = useRecoilState( - resetPWCompletePopupShow, - ); - const setStepIndex = useSetRecoilState(stepIndex); const [open1, setOpen1] = React.useState(true); @@ -62,68 +53,6 @@ const SettingPage = () => { ); }; - const completePopupComponent = () => { - return ( - - setCompletePopupShow(false)}> - <> - - - - - - - - - - - - - - - - {'비밀번호가 변경되었습니다.'} - - - - - ); - }; - - useEffect(() => { setStepIndex(0); }); @@ -205,7 +134,6 @@ const SettingPage = () => { - {completePopupShow && completePopupComponent()} ); };