Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
최원빈 committed Apr 10, 2024
2 parents b887435 + e3d6aa2 commit a0aba08
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 21 deletions.
24 changes: 24 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@bcsdlab/koin": "^0.0.15",
"@hookform/resolvers": "^3.1.0",
"@tanstack/react-query": "^5.8.1",
"@testing-library/jest-dom": "^5.14.1",
Expand Down
33 changes: 24 additions & 9 deletions src/page/Auth/Signup/component/ErrorMessage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,31 @@ import { ReactComponent as Warn } from 'assets/svg/auth/warning.svg';
import styles from './ErrorMessage.module.scss';

interface ErrorMessageProps {
message:string | (string | undefined)[]
message: string | (string | undefined | null)[]
}

export default function ErrorMessage({ message }:ErrorMessageProps) {
return (
<div className={styles.warn}>
<Warn />
<span className={styles['warn--phrase']}>
{typeof message === 'string' ? message : message[0]}
</span>
</div>
);
if (typeof message === 'string') {
return (
<div className={styles.warn}>
<Warn />
<span className={styles['warn--phrase']}>
{message}
</span>
</div>
);
}

if (message.length > 0) {
return (
<div className={styles.warn}>
<Warn />
<span className={styles['warn--phrase']}>
{typeof message === 'string' ? message : message[0]}
</span>
</div>
);
}

return null;
}
3 changes: 2 additions & 1 deletion src/page/Auth/Signup/hooks/useCheckEmailDuplicate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import {
import { SubmitHandler } from 'react-hook-form';
import { User } from 'page/Auth/Signup/types/User';
import useRegisterInfo from 'store/registerStore';
import { isKoinError } from '@bcsdlab/koin';

export default function useCheckEmailDuplicate(isMobile: boolean) {
const [email, setEmail] = useState<string>('');
const { status, refetch, error } = useCheckDuplicate(email);
const { userInfo: userData, setUserInfo: setId } = useRegisterInfo();
const debounceSearch = useRef<NodeJS.Timeout>();
const errorMessage:string | undefined = status === 'error' ? Object(error).response.data.message : null;
const errorMessage = isKoinError(error) && error.status === 409 ? '이미 사용중인 아이디입니다.' : null;
const onSubmit:SubmitHandler<User> = (data) => {
setEmail(() => (data.email ? data.email : ''));
};
Expand Down
2 changes: 1 addition & 1 deletion src/query/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { useErrorMessageStore } from 'store/errorMessageStore';
import useUserTypeStore from 'store/userType';
import { isKoinError } from 'utils/ts/isKoinError';
import useUserStore from 'store/user';
import { isKoinError } from '@bcsdlab/koin';

interface VerifyInput {
email: string;
Expand Down
10 changes: 0 additions & 10 deletions src/utils/ts/isKoinError.ts

This file was deleted.

10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,15 @@ __metadata:
languageName: node
linkType: hard

"@bcsdlab/koin@npm:^0.0.15":
version: 0.0.15
resolution: "@bcsdlab/koin@npm:0.0.15"
peerDependencies:
axios: ^0.27.2
checksum: 30b1904180a8278bdc45cbb487e10c88da6034d74964070a2837694df16b87606535b45bc5675f4f8038d7530b9d2ecf009b11d360bc572141fe92ba3ef6059e
languageName: node
linkType: hard

"@csstools/normalize.css@npm:*":
version: 12.1.1
resolution: "@csstools/normalize.css@npm:12.1.1"
Expand Down Expand Up @@ -8982,6 +8991,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "koin_owner_web@workspace:."
dependencies:
"@bcsdlab/koin": ^0.0.15
"@hookform/resolvers": ^3.1.0
"@tanstack/react-query": ^5.8.1
"@testing-library/jest-dom": ^5.14.1
Expand Down

0 comments on commit a0aba08

Please sign in to comment.