Skip to content

Commit 1ac0a2d

Browse files
committed
feat: Button 컴포넌트 재사용
원래 그냥 <button />을 사용했는데 commons/Button을 사용 Resolve: #147
1 parent c36058d commit 1ac0a2d

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

client/src/components/VoteBlock/index.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { BiX } from '@react-icons/all-files/bi/BiX';
22
import classNames from 'classnames/bind';
33
import React, { useState, useRef } from 'react';
44

5+
import Button from '../common/Button';
56
import style from './style.module.scss';
67

78
const cx = classNames.bind(style);
@@ -82,12 +83,12 @@ function VoteBlock() {
8283
></input>
8384
</div>
8485
<div className={style['vote-buttons']}>
85-
<button className={style.button} onClick={onAdd}>
86-
항목 추가
87-
</button>
88-
<button className={style.button} onClick={onRegister}>
89-
투표 등록
90-
</button>
86+
<Button className={style.button} onClick={onAdd} text="항목 추가" />
87+
<Button
88+
className={style.button}
89+
onClick={onRegister}
90+
text="투표 등록"
91+
/>
9192
</div>
9293
</>
9394
)}

client/src/components/VoteBlock/style.module.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,23 @@
7575
margin-top: 20px;
7676

7777
.button {
78+
display: flex;
79+
align-items: center;
80+
justify-content: center;
81+
7882
width: 100px;
7983
height: 30px;
80-
8184
margin-left: 12px;
85+
padding: 0px;
8286

8387
border-radius: 8px;
8488

8589
background-color: $primary-100;
8690
color: $white;
91+
92+
span {
93+
padding: 0px;
94+
}
8795
}
8896
}
8997
}

0 commit comments

Comments
 (0)