Skip to content

Commit

Permalink
Upt. change button text
Browse files Browse the repository at this point in the history
  • Loading branch information
jee-eun-k committed Feb 20, 2024
1 parent a9fbbb8 commit 1fb0d84
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 37 deletions.
1 change: 0 additions & 1 deletion src/api/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export const getInstance = (isLoading = true, params?: any): AxiosInstance => {
async (
config: InternalAxiosRequestConfig,
): Promise<InternalAxiosRequestConfig> => {

// set bearer authorization token to the header
if (config.headers) {
const accessToken = cookie.get(ACCESS_TOKEN);
Expand Down
6 changes: 3 additions & 3 deletions src/pages/auth/resetPW/ResetPWMode.tsx
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -49,7 +49,7 @@ const ResetPWMode = (props: any) => {
setStepType('RESETPW');
setNextButtonProps({
...nextButtonProps,
text: '다음',
text: buttonText.next,
isDisabled: false,
clickHandler: props.handleNextButton,
});
Expand Down
3 changes: 2 additions & 1 deletion src/pages/auth/signup/CheckTermsAndConditions.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { buttonText } from '@/constants/message';
import { stepButtonProps, stepInstruction } from '@/store/common';
import { theme } from '@/styles';
import {
Expand Down Expand Up @@ -105,7 +106,7 @@ const CheckTermsAndConditions = (props: any) => {
setInstruction('서비스를 이용하기 위해 약관에 동의 해주세요.');
setNextButtonProps({
...nextButtonProps,
text: '다음',
text: buttonText.next,
isDisabled: true,
clickHandler: props.handleNextButton,
});
Expand Down
3 changes: 2 additions & 1 deletion src/pages/auth/signup/SetPW.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -94,7 +95,7 @@ const SetPW = (props: any) => {
useEffect(() => {
setSignUpStepInstruction('비밀번호를 입력해주세요.');
setSignUpNextButtonProps({
text: '다음',
text: buttonText.next,
clickHandler: props.handleNextButton,
isDisabled: true,
});
Expand Down
30 changes: 2 additions & 28 deletions src/store/resetPW.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -16,36 +14,12 @@ export const resetPWStepPages = atom<ReactElement[]>({
});


// // 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,
},
});

Expand Down
6 changes: 3 additions & 3 deletions src/store/signUp.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down Expand Up @@ -30,14 +31,13 @@ export const signInUpNextButtonState = atom<INextButtonState>({
default: {
isDisabled: true,
clickHandler: () => {},
text: '다음'
text: buttonText.next,
}
});


export const signInUpStepInstruction = atom<string>({
key: 'signInUpStepInstruction',
default: '다음',
default: buttonText.next,
});

// sign up custom hook
Expand Down

0 comments on commit 1fb0d84

Please sign in to comment.