Skip to content

Commit 5357ae6

Browse files
committed
refactor: 불필요한 스타일 정리
1 parent 23849f1 commit 5357ae6

File tree

5 files changed

+26
-33
lines changed

5 files changed

+26
-33
lines changed

src/app/components/button/BookmarkBtn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const BookmarkBtn: React.FC<BookmarkBtnProps> = ({ className = "" }) => {
1414
};
1515

1616
const baseStyles =
17-
"inline-flex items-center justify-center transition-colors rounded-full w-54 h-54 p-4 bg-orange-50";
17+
"inline-flex items-center justify-center transition-colors rounded-full h-12 w-12 p-2 bg-orange-50";
1818

1919
const iconStyles = "text-xl text-primary-orange-300";
2020

src/app/components/button/Button.tsx

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"use client";
2-
32
import React, { ButtonHTMLAttributes, ReactNode } from "react";
43

54
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
@@ -8,7 +7,6 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
87
radius?: "lg" | "full";
98
icon?: ReactNode;
109
}
11-
1210
/**
1311
* 버튼 컴포넌트
1412
* @param variant - 버튼 스타일 solid | outlined
@@ -20,7 +18,7 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
2018
* @param props - 추가 버튼 속성
2119
* @returns 버튼 컴포넌트
2220
*/
23-
const Button = ({
21+
const Button: React.FC<ButtonProps> = ({
2422
className = "",
2523
variant = "solid",
2624
width = "md",
@@ -29,22 +27,14 @@ const Button = ({
2927
disabled = false,
3028
children,
3129
...props
32-
}: ButtonProps) => {
30+
}) => {
3331
const baseStyles = "inline-flex items-center justify-center transition-colors font-medium h-12";
3432

3533
const variants = {
36-
solid: [
37-
"bg-primary-orange-300 text-gray-100",
38-
"hover:bg-primary-orange-200",
39-
"focus:ring-1 focus:ring-primary-orange-200 focus:outline-none",
40-
"disabled:bg-gray-100 disabled:cursor-not-allowed text-white",
41-
].join(" "),
42-
outlined: [
43-
"border-2 border-primary-orange-300 text-primary-orange-300",
44-
"hover:border-primary-orange-200 hover:text-primary-orange-200",
45-
"focus:ring-1 focus:ring-primary-orange-200 focus:outline-none",
46-
"disabled:border-gray-100 disabled:text-gray-100 disabled:cursor-not-allowed disabled:hover:bg-transparent",
47-
].join(" "),
34+
solid:
35+
"bg-primary-orange-300 text-gray-100 hover:bg-primary-orange-200 focus:ring-1 focus:ring-primary-orange-200 focus:outline-none disabled:bg-gray-100 disabled:cursor-not-allowed text-white",
36+
outlined:
37+
"border-2 border-primary-orange-300 text-primary-orange-300 hover:border-primary-orange-200 hover:text-primary-orange-200 focus:ring-1 focus:ring-primary-orange-200 focus:outline-none disabled:border-gray-100 disabled:text-gray-100 disabled:cursor-not-allowed disabled:hover:bg-transparent",
4838
};
4939

5040
const widths = {
@@ -65,7 +55,7 @@ const Button = ({
6555
disabled={disabled}
6656
{...props}
6757
>
68-
{icon && <span className="mr-2">{icon}</span>} {/* 아이콘 렌더링 */}
58+
{icon && <span className="mr-2">{icon}</span>}
6959
{children}
7060
</button>
7161
);

src/app/components/button/CheckBtn.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,25 @@ interface CheckBtnProps extends InputHTMLAttributes<HTMLInputElement> {
77
value: string; // 체크박스의 value 속성
88
checked?: boolean; // 체크박스가 선택된 상태인지 여부
99
disabled?: boolean; // 체크박스가 비활성화된 상태인지 여부
10-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void; // 체크박스 상태 변화 처리 함수
10+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
1111
}
1212

13-
const CheckBtn = ({ label, name, value, checked = false, disabled = false, onChange, ...props }: CheckBtnProps) => {
14-
const baseStyles = "flex items-center justify-between rounded-lg";
13+
const CheckBtn: React.FC<CheckBtnProps> = ({
14+
label,
15+
name,
16+
value,
17+
checked = false,
18+
disabled = false,
19+
onChange,
20+
...props
21+
}) => {
22+
const baseStyles = "flex items-center justify-between rounded-lg p-2";
1523

1624
const textColor = disabled ? "text-gray-400" : "text-black";
1725
const cursorStyle = disabled ? "cursor-not-allowed" : "cursor-pointer";
1826

1927
return (
20-
<div className={`${baseStyles} ${cursorStyle} p-2`}>
28+
<div className={`${baseStyles} ${cursorStyle}`}>
2129
<label htmlFor={value} className={`text-sm ${textColor}`}>
2230
{label}
2331
</label>

src/app/components/button/FrameRadioBtn.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,22 @@ interface FrameRadioBtnProps extends ButtonHTMLAttributes<HTMLInputElement> {
1111
disabled?: boolean; // 라디오 버튼이 비활성화된 상태인지 여부
1212
}
1313

14-
const FrameRadioBtn = ({ width = "sm", checked = false, disabled = false, ...props }: FrameRadioBtnProps) => {
15-
const baseStyles = "flex items-center justify-between rounded-lg border";
14+
const FrameRadioBtn: React.FC<FrameRadioBtnProps> = ({ width = "sm", checked = false, disabled = false, ...props }) => {
15+
const baseStyles = "flex items-center justify-between rounded-lg border px-5 py-4";
1616

1717
const widths = {
18-
sm: "w-[252px] px-5 py-4",
19-
md: "w-[360px] px-6 py-5",
18+
sm: "w-[252px]",
19+
md: "w-[360px]",
2020
};
2121

22-
const labelTextSize = width === "sm" ? "text-sm" : "text-base";
23-
const bgColor = disabled ? "none" : checked ? "bg-primary-orange-50" : "bg-white";
22+
const bgColor = disabled ? "bg-gray-200" : checked ? "bg-primary-orange-50" : "bg-white";
2423
const borderColor = disabled ? "border-gray-200" : "border-primary-orange-300";
2524
const textColor = disabled ? "text-gray-400" : "text-black";
2625
const cursorStyle = disabled ? "cursor-not-allowed" : "cursor-pointer";
2726

2827
return (
2928
<div className={`${baseStyles} ${widths[width]} ${bgColor} ${borderColor} ${cursorStyle}`}>
30-
<label htmlFor={props.value} className={`${labelTextSize} ${textColor}`}>
29+
<label htmlFor={props.value} className={`text-sm ${textColor}`}>
3130
{props.label}
3231
</label>
3332
<input

src/app/globals.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,13 @@ input[type="checkbox"]:disabled {
9292
font-family: "HakgyoansimDunggeunmisoTTF-R";
9393
src: url("https://fastly.jsdelivr.net/gh/projectnoonnu/[email protected]/HakgyoansimDunggeunmisoTTF-R.woff2") format("woff2");
9494
font-weight: 400;
95-
font-style: normal;
9695
}
9796

9897
/* 학교안심 둥근미소 B */
9998
@font-face {
10099
font-family: "HakgyoansimDunggeunmisoTTF-B";
101100
src: url("https://fastly.jsdelivr.net/gh/projectnoonnu/[email protected]/HakgyoansimDunggeunmisoTTF-B.woff2") format("woff2");
102101
font-weight: 700;
103-
font-style: normal;
104102
}
105103

106104
/* 넥슨 폰트 */
@@ -109,14 +107,12 @@ input[type="checkbox"]:disabled {
109107
src: url("https://fastly.jsdelivr.net/gh/projectnoonnu/[email protected]/NEXON Lv1 Gothic OTF Light.woff")
110108
format("woff");
111109
font-weight: 300;
112-
font-style: normal;
113110
}
114111
@font-face {
115112
font-family: "NEXON Lv1 Gothic OTF Regular";
116113
src: url("https://fastly.jsdelivr.net/gh/projectnoonnu/[email protected]/NEXON Lv1 Gothic OTF Regular.woff")
117114
format("woff");
118115
font-weight: 400;
119-
font-style: normal;
120116
}
121117
@font-face {
122118
font-family: "NEXON Lv1 Gothic OTF Bold";

0 commit comments

Comments
 (0)