Skip to content

Commit cdf230d

Browse files
feat: Button 컴포넌트 수정 (#122)
* fix: Button 컴포넌트에 outlined prop 추가 * style: 탈퇴하기 폼 버튼 스타일링 반영 * fix: 리뷰 반영 - boxShadow로 수정 Co-authored-by: Jungwoo LEE <[email protected]> * fix: 온클릭 이벤트 누락 추가 및 css 수정 --------- Co-authored-by: Jungwoo LEE <[email protected]>
1 parent 91e233a commit cdf230d

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

src/app/delete-account/delete-account.css.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,11 @@ export const fixedButtonWrapper = style({
8484

8585
padding: "0 2rem",
8686
});
87+
88+
export const deleteButton = style({
89+
flex: 1,
90+
});
91+
92+
export const continueButton = style({
93+
flex: 2,
94+
});

src/app/delete-account/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ export default function page() {
5151
</article>
5252

5353
<div className={styles.fixedButtonWrapper}>
54-
<Button onClick={handleClickDeleteAccount}>탈퇴하기</Button>
55-
<Button>계속 이용하기</Button>
54+
<Button className={styles.deleteButton} outlined onClick={handleClickDeleteAccount}>
55+
탈퇴하기
56+
</Button>
57+
<Button className={styles.continueButton}>계속 이용하기</Button>
5658
</div>
5759
</>
5860
);

src/components/Common/Button/Button.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import { type ButtonHTMLAttributes, ReactNode, memo } from "react";
22

33
import clsx from "clsx";
4-
import { buttonStyle } from "./button.css";
4+
import { buttonStyle, outlinedStyle } from "./button.css";
55

66
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
77
children: ReactNode;
8+
outlined?: boolean;
89
}
910

10-
function Button({ children, className, ...buttonElementProps }: ButtonProps) {
11+
function Button({ children, className, outlined, ...buttonElementProps }: ButtonProps) {
1112
return (
12-
<button className={clsx(buttonStyle, className)} {...buttonElementProps}>
13+
<button className={clsx(buttonStyle, outlined && outlinedStyle, className)} {...buttonElementProps}>
1314
{children}
1415
</button>
1516
);

src/components/Common/Button/button.css.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { style } from '@vanilla-extract/css';
1+
import { style } from "@vanilla-extract/css";
22
import { vars } from "@/styles/theme.css";
33

44
export const buttonStyle = style({
@@ -18,4 +18,10 @@ export const buttonStyle = style({
1818
color: vars.color.grey_6,
1919
},
2020
},
21-
});
21+
});
22+
23+
export const outlinedStyle = style({
24+
background: vars.color.white,
25+
boxShadow: `inset 0 0 0 1px ${vars.color.grey_4}`,
26+
color: vars.color.grey_6,
27+
});

0 commit comments

Comments
 (0)