From 1fb0d846bd4fd0500888ad169b5eb7fd9abfff87 Mon Sep 17 00:00:00 2001 From: choba Date: Tue, 20 Feb 2024 09:15:04 +0100 Subject: [PATCH] Upt. change button text --- src/api/http.ts | 1 - src/pages/auth/resetPW/ResetPWMode.tsx | 6 ++-- .../auth/signup/CheckTermsAndConditions.tsx | 3 +- src/pages/auth/signup/SetPW.tsx | 3 +- src/store/resetPW.ts | 30 ++----------------- src/store/signUp.ts | 6 ++-- 6 files changed, 12 insertions(+), 37 deletions(-) diff --git a/src/api/http.ts b/src/api/http.ts index 5ef797a..be440d7 100644 --- a/src/api/http.ts +++ b/src/api/http.ts @@ -63,7 +63,6 @@ export const getInstance = (isLoading = true, params?: any): AxiosInstance => { async ( config: InternalAxiosRequestConfig, ): Promise => { - // set bearer authorization token to the header if (config.headers) { const accessToken = cookie.get(ACCESS_TOKEN); diff --git a/src/pages/auth/resetPW/ResetPWMode.tsx b/src/pages/auth/resetPW/ResetPWMode.tsx index 06ebb7e..f3ccebd 100644 --- a/src/pages/auth/resetPW/ResetPWMode.tsx +++ b/src/pages/auth/resetPW/ResetPWMode.tsx @@ -1,10 +1,10 @@ +import { buttonText } from '@/constants/message'; import { currentFormType, stepButtonProps } from '@/store/common'; -import { resetPWMode, resetPWNextButtonState } from '@/store/resetPW'; +import { resetPWMode } from '@/store/resetPW'; import { Button, Container } from '@mui/material'; import Typography from '@mui/material/Typography'; import { useEffect } from 'react'; import { useRecoilState, useSetRecoilState } from 'recoil'; - const ResetPWMode = (props: any) => { const [nextButtonProps, setNextButtonProps] = useRecoilState(stepButtonProps); const [pWChgMode, setPWChgMode] = useRecoilState(resetPWMode); @@ -49,7 +49,7 @@ const ResetPWMode = (props: any) => { setStepType('RESETPW'); setNextButtonProps({ ...nextButtonProps, - text: '다음', + text: buttonText.next, isDisabled: false, clickHandler: props.handleNextButton, }); diff --git a/src/pages/auth/signup/CheckTermsAndConditions.tsx b/src/pages/auth/signup/CheckTermsAndConditions.tsx index c8888fe..073932d 100644 --- a/src/pages/auth/signup/CheckTermsAndConditions.tsx +++ b/src/pages/auth/signup/CheckTermsAndConditions.tsx @@ -1,3 +1,4 @@ +import { buttonText } from '@/constants/message'; import { stepButtonProps, stepInstruction } from '@/store/common'; import { theme } from '@/styles'; import { @@ -105,7 +106,7 @@ const CheckTermsAndConditions = (props: any) => { setInstruction('서비스를 이용하기 위해 약관에 동의 해주세요.'); setNextButtonProps({ ...nextButtonProps, - text: '다음', + text: buttonText.next, isDisabled: true, clickHandler: props.handleNextButton, }); diff --git a/src/pages/auth/signup/SetPW.tsx b/src/pages/auth/signup/SetPW.tsx index 2371bb8..c97a91e 100644 --- a/src/pages/auth/signup/SetPW.tsx +++ b/src/pages/auth/signup/SetPW.tsx @@ -7,6 +7,7 @@ import { useEffect, useState } from 'react'; import { useRecoilState, useSetRecoilState } from 'recoil'; import InputForm, { InputItemType } from '../common/InputForm'; import { checkPattern } from '@/hooks/checkPattern'; +import { buttonText } from '@/constants/message'; const { checkPasswordValidity } = checkPattern(); @@ -94,7 +95,7 @@ const SetPW = (props: any) => { useEffect(() => { setSignUpStepInstruction('비밀번호를 입력해주세요.'); setSignUpNextButtonProps({ - text: '다음', + text: buttonText.next, clickHandler: props.handleNextButton, isDisabled: true, }); diff --git a/src/store/resetPW.ts b/src/store/resetPW.ts index c32183c..0cae2c4 100644 --- a/src/store/resetPW.ts +++ b/src/store/resetPW.ts @@ -1,6 +1,4 @@ -import ResetPW from '@/pages/auth/resetPW/ResetPW'; -import ResetPWMode from '@/pages/auth/resetPW/ResetPWMode'; -import { ReactJSXElement } from '@emotion/react/types/jsx-namespace'; +import { buttonText } from '@/constants/message'; import { ReactElement } from 'react'; import { atom } from 'recoil'; @@ -16,36 +14,12 @@ export const resetPWStepPages = atom({ }); -// // sign up user data -// interface ISignUpDataState { -// email: string, -// nickname: string, -// password: string, -// } - -// const signUpDataState = atom({ -// key: 'signUpData', -// default: { -// email: '', -// nickname: '', -// password: '', -// }, -// dangerouslyAllowMutability: false -// }); - -// // sign up next button props -// interface ISignInUpNextButtonState { -// isDisabled: boolean, -// clickHandler: () => void, -// text: string -// } - export const resetPWNextButtonState = atom({ key: 'ResetPWNextButton', default: { isDisabled: true, clickHandler: () => {}, - text: '다음', + text: buttonText.next, }, }); diff --git a/src/store/signUp.ts b/src/store/signUp.ts index dd4bc77..f88c082 100644 --- a/src/store/signUp.ts +++ b/src/store/signUp.ts @@ -1,5 +1,6 @@ import { atom } from 'recoil'; import { INextButtonState } from './common'; +import { buttonText } from '@/constants/message'; // sign up step current index export const signUpStep = atom({ @@ -30,14 +31,13 @@ export const signInUpNextButtonState = atom({ default: { isDisabled: true, clickHandler: () => {}, - text: '다음' + text: buttonText.next, } }); - export const signInUpStepInstruction = atom({ key: 'signInUpStepInstruction', - default: '다음', + default: buttonText.next, }); // sign up custom hook