Skip to content

Commit b3bf487

Browse files
Merge pull request #28 from DeveloperBlog-Devflow/feature/home-page
refactor: 홈 페이지 컴포넌트 간격 수정 및 변수명 변경
2 parents c963d08 + 7236e52 commit b3bf487

4 files changed

Lines changed: 18 additions & 14 deletions

File tree

app/(with-sidebar)/(home)/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ import ButtonSection from '@/components/home/ButtonSection';
66

77
const Page = () => {
88
return (
9-
<div className="bg-background flex min-h-screen flex-col gap-6 font-sans md:p-[137px]">
9+
<div className="bg-background flex min-h-screen flex-col gap-4 font-sans md:p-[137px]">
1010
{/* 1. Header */}
1111
<HeaderSection />
1212

1313
{/* 2-1. ProfileSection */}
14-
<ProfileSection className="grid grid-cols-1 gap-6 md:grid-cols-3" />
14+
<ProfileSection className="grid grid-cols-1 gap-4 md:grid-cols-3" />
1515

1616
{/* 2-2. GraphSection */}
1717
<GraphSection></GraphSection>
1818

1919
{/* 2-3. BottomSection */}
20-
<BottomSection className="grid grid-cols-1 gap-6 md:grid-cols-2" />
20+
<BottomSection className="grid grid-cols-1 gap-4 md:grid-cols-2" />
2121

2222
{/* 3. ButtonSection */}
2323
<ButtonSection />

components/home/BottomSection.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ interface BottomSectionProps {
99
}
1010

1111
const TODAY_DUMMY = [
12-
{ id: 't1', text: 'React Hooks 정리', checked: false },
13-
{ id: 't2', text: 'GSAP ScrollTrigger 복습', checked: true },
14-
{ id: 't3', text: '알고리즘 1문제 풀기', checked: false },
12+
{ id: 't1', text: 'React Hooks 정리', isChecked: false },
13+
{ id: 't2', text: 'GSAP ScrollTrigger 복습', isChecked: true },
14+
{ id: 't3', text: '알고리즘 1문제 풀기', isChecked: false },
1515
];
1616

1717
const UPCOMING_DUMMY = [
18-
{ id: 'u1', text: 'Next.js App Router 정리', checked: false },
19-
{ id: 'u2', text: '포트폴리오 리팩토링', checked: false },
18+
{ id: 'u1', text: 'Next.js App Router 정리', isChecked: false },
19+
{ id: 'u2', text: '포트폴리오 리팩토링', isChecked: false },
2020
];
2121

2222
export default function BottomSection({ className }: BottomSectionProps) {
@@ -25,13 +25,17 @@ export default function BottomSection({ className }: BottomSectionProps) {
2525

2626
const toggleToday = (id: string) => {
2727
setToday((prev) =>
28-
prev.map((it) => (it.id === id ? { ...it, checked: !it.checked } : it))
28+
prev.map((it) =>
29+
it.id === id ? { ...it, isChecked: !it.isChecked } : it
30+
)
2931
);
3032
};
3133

3234
const toggleUpcoming = (id: string) => {
3335
setUpcoming((prev) =>
34-
prev.map((it) => (it.id === id ? { ...it, checked: !it.checked } : it))
36+
prev.map((it) =>
37+
it.id === id ? { ...it, isChecked: !it.isChecked } : it
38+
)
3539
);
3640
};
3741

components/home/CheckItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function CheckItem({ checked, text, onToggle }: CheckItemProps) {
1414
type="button"
1515
onClick={onToggle}
1616
className={[
17-
'flex w-full items-center gap-4 rounded-2xl border px-5 py-2 text-left transition',
17+
'flex w-full items-center gap-2.5 rounded-2xl border px-4 py-2 text-left transition',
1818
'bg-gray-50 hover:bg-gray-100',
1919
'border-gray-300',
2020
].join(' ')}

components/home/CheckList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { CheckItem } from './CheckItem';
55
export type ChecklistItem = {
66
id: string;
77
text: string;
8-
checked: boolean;
8+
isChecked: boolean;
99
};
1010

1111
interface CheckListProps {
@@ -24,11 +24,11 @@ export default function CheckList({
2424
}
2525

2626
return (
27-
<div className="space-y-3">
27+
<div className="space-y-2.5">
2828
{items.map((item) => (
2929
<CheckItem
3030
key={item.id}
31-
checked={item.checked}
31+
checked={item.isChecked}
3232
text={item.text}
3333
onToggle={() => onToggle(item.id)}
3434
/>

0 commit comments

Comments
 (0)