Skip to content

Commit 1edb361

Browse files
authored
Merge pull request #135 from imaginer-dev/49-search-user
feat: νšŒμ› 검색 api κ΅¬ν˜„
2 parents c4f819f + 8c7eca4 commit 1edb361

19 files changed

+194
-19
lines changed

β€Žsrc/apis/authApis.tsβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,12 @@ export const recoveryPasswd = async (email: string) => {
5353
}
5454
return data;
5555
};
56+
57+
export const searchUser = async (nickname: string) => {
58+
const { data: profiles, error } = await supabase.from('profiles').select().eq('user_nickname', nickname);
59+
if (error) {
60+
throw error;
61+
}
62+
63+
return profiles;
64+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const IconPlus = () => {
2+
return (
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
fill="none"
6+
viewBox="0 0 24 24"
7+
strokeWidth="1.5"
8+
stroke="currentColor"
9+
className={'h-6 w-6'}
10+
>
11+
<path strokeLinecap="round" strokeLinejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
12+
</svg>
13+
);
14+
};
15+
16+
export default IconPlus;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const IconSearch = () => {
2+
return (
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
fill="none"
6+
viewBox="0 0 24 24"
7+
strokeWidth="1.5"
8+
stroke="currentColor"
9+
className={'h-6 w-6'}
10+
>
11+
<path
12+
strokeLinecap="round"
13+
strokeLinejoin="round"
14+
d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
15+
/>
16+
</svg>
17+
);
18+
};
19+
20+
export default IconSearch;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const IconUserPlus = () => {
2+
return (
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
fill="none"
6+
viewBox="0 0 24 24"
7+
strokeWidth="1.5"
8+
stroke="currentColor"
9+
className={'h-6 w-6'}
10+
>
11+
<path
12+
strokeLinecap="round"
13+
strokeLinejoin="round"
14+
d="M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"
15+
/>
16+
</svg>
17+
);
18+
};
19+
20+
export default IconUserPlus;
File renamed without changes.

β€Žsrc/components/Join/JoinButton.tsxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import useSignUp from '@/react-queries/useSignUp';
66
import { isAuthError } from '@supabase/supabase-js';
77
import { useNavigate } from 'react-router-dom';
88
import { Loading } from '@/pages';
9-
import Dialog from '../Dialog';
9+
import Dialog from '../common/Dialog.tsx';
1010

1111
interface DialogElement {
1212
openModal: () => void;
File renamed without changes.

β€Žsrc/components/Dialog.tsxβ€Ž renamed to β€Žsrc/components/common/Dialog.tsxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const Dialog = forwardRef<DialogElement, Props>((props, ref) => {
3434
<dialog ref={dialogRef} className="modal modal-middle" onClick={handleClose}>
3535
<div className="modal-box" onClick={(e) => e.stopPropagation()}>
3636
{title && <h3 className="text-lg font-bold">{title}</h3>}
37-
<p className={descClassName}>{desc}</p>
37+
{desc && <p className={descClassName}>{desc}</p>}
3838
{children && <div>{children}</div>}
3939
<form method="dialog" className="modal-action flex justify-center">
4040
<button type="button" className="btn bg-primary text-base-100" onClick={() => dialogRef.current?.close()}>

β€Žsrc/components/DialogButton.tsxβ€Ž renamed to β€Žsrc/components/common/DialogButton.tsxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface DialogElement {
88

99
interface Props {
1010
classname?: string;
11-
name: string;
11+
name: any;
1212
title?: string;
1313
desc: string;
1414
children?: ReactNode;

β€Žsrc/components/common/InputForm.tsxβ€Ž

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ const InputForm: React.FC<Props> = ({ title, placeholder, hint, onChange, error
2222
onChange={onChange}
2323
{...rest}
2424
/>
25-
<div className="label flex h-8 flex-row items-center">
26-
<span className={`label-text-alt ${error ? 'text-error' : ''}`}>{error ? errorText : hint}</span>
27-
</div>
25+
{error || hint ? (
26+
<div className="label flex h-8 flex-row items-center">
27+
<span className={`label-text-alt ${error ? 'text-error' : ''}`}>{error ? errorText : hint}</span>
28+
</div>
29+
) : (
30+
''
31+
)}
2832
</label>
2933
);
3034
};

0 commit comments

Comments
Β (0)