Skip to content

Commit b057fe4

Browse files
committed
fix: 공통 컴포넌트 수정
**DialogButton** form 안에서 사용시 버튼이 submit으로 기본적으로 동작함. - 타입을 button으로 수정 **HistoryBackButton** svg 아이콘 모양이 이상함 - figma에서 export 해서 다시 붙여넣어 수정 **UserInviteDialog** 마찬가지로 버튼 type 수정 **UserInviteList** 버튼 type 수정 및 list에 key 값 할당
1 parent 5cf0285 commit b057fe4

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

src/components/common/DialogButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function DialogButton({ classname, name, title, desc, children }: Props) {
2525

2626
return (
2727
<div>
28-
<button className={classname} onClick={() => openModal(dialogRef)}>
28+
<button type="button" className={classname} onClick={() => openModal(dialogRef)}>
2929
{name}
3030
</button>
3131
<Dialog ref={dialogRef} title={title} desc={desc}>

src/components/common/HistoryBackButton.tsx

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,14 @@ const HistoryBackButton: React.FC = () => {
88
};
99

1010
return (
11-
<div className="mr-auto w-3 md:w-4">
12-
<svg
13-
onClick={handleBack}
14-
className={'shrink-0'}
15-
width="100%"
16-
height="100%"
17-
viewBox="0 0 256 512"
18-
fill="#429400"
19-
preserveAspectRatio="xMinYMin meet"
20-
xmlns="http://www.w3.org/2000/svg"
21-
>
22-
<path d="M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 256c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z" />
11+
<button type="button" onClick={handleBack}>
12+
<svg width="13" height="16" viewBox="0 0 13 16" fill="none" xmlns="http://www.w3.org/2000/svg">
13+
<path
14+
d="M10.7 15.1595C11.6989 15.7893 13 15.0714 13 13.8907L13 2.10951C13 0.928727 11.6989 0.21091 10.7 0.840621L1.35638 6.73119C0.422984 7.31964 0.422986 8.68052 1.35638 9.26897L10.7 15.1595Z"
15+
fill="#429400"
16+
/>
2317
</svg>
24-
</div>
18+
</button>
2519
);
2620
};
2721

src/components/common/UserInviteDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const UserInvite: FC = () => {
2020
}
2121
setList(
2222
nickNames.map(({ user_nickname, id }) => {
23-
return <UserInviteList user_nickname={user_nickname} id={id} />;
23+
return <UserInviteList user_nickname={user_nickname} id={id} key={id + '-UserInviteList'} />;
2424
}),
2525
);
2626
return list;
@@ -31,7 +31,7 @@ const UserInvite: FC = () => {
3131
<div>
3232
<div className="flex items-end">
3333
<InputForm title={'닉네임으로 검색하기'} placeholder={'닉네임을 입력하세요'} hint={''} onChange={onChange} />
34-
<button className="btn btn-outline btn-primary" onClick={onSearchClick}>
34+
<button type="button" className="btn btn-outline btn-primary" onClick={onSearchClick}>
3535
<IconSearch />
3636
</button>
3737
</div>

src/components/common/UserInviteList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface Props {
99
const UserInviteList: FC<Props> = ({ user_nickname, id }) => {
1010
return (
1111
<li key={id} className="border-b">
12-
<button className="ju btn block flex w-full justify-between border-none bg-transparent" onClick={onClick}>
12+
<button type="button" className="ju btn flex w-full justify-between border-none bg-transparent" onClick={onClick}>
1313
{user_nickname}
1414
<IconPlus />
1515
</button>

0 commit comments

Comments
 (0)