Skip to content

Commit 67c7904

Browse files
authored
Merge pull request #167 from Boggle-Boggle/develop
Develop -> Staging
2 parents e3dbcc4 + 959977f commit 67c7904

6 files changed

Lines changed: 106 additions & 22 deletions

File tree

AGENTS.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ The current codebase consists of legacy code from an older version of bbaegok th
88

99
- All responses must be written in Korean.
1010
- All plans must be written in Korean.
11+
- Always perform work in the smallest possible unit.
12+
- Do not modify many files at once.
13+
- If multiple files need to be modified, split the work into multiple steps.
14+
- After each step is completed, request user confirmation before proceeding to the next step.
15+
- Do not proceed to the next step without explicit user approval.
16+
17+
## Figma API Usage Rules
18+
19+
- The Figma API has rate limits, so repeated requests for the same resource must be cached and reused.
20+
- Figma API requests must always be minimized.
1121

1222
## Tech Stack
1323

@@ -359,7 +369,7 @@ return (
359369
**Code inside a file containing components should be ordered as follows:**
360370

361371
1. Imports
362-
2. Interface and type definitions
372+
2. type definitions
363373
3. Component-specific constants (consider future i18n support)
364374
4. Component
365375
5. Sub-components

src/components/BookCase/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,11 @@ export const BookCase = () => {
258258
return (
259259
<div
260260
style={{ boxShadow: outerBoxShadow, height: outerHeight }}
261-
className="w-[21.438rem] rounded-[32px] border border-neutral-20 bg-neutral-0 p-5"
261+
className="w-full rounded-[32px] border border-neutral-20 bg-neutral-0 p-5"
262262
>
263263
<div
264264
style={{ boxShadow: innerBoxShadow, height: innerHeight, background: innerBackground }}
265-
className="flex w-[18.938rem] flex-col justify-start rounded-xl py-4"
265+
className="flex w-full flex-col justify-start rounded-xl py-4"
266266
>
267267
{allBooks.map((shelfBooks, idx) => {
268268
const shelfSpacingClass = idx === allBooks.length - 1 ? '' : 'pb-4';
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { Meta, StoryObj } from '@storybook/react-vite';
2+
3+
import { MemoryRouter } from 'react-router-dom';
4+
5+
import { Header } from './index';
6+
import Search from '../icons/Search';
7+
8+
const meta: Meta<typeof Header> = {
9+
title: 'Components/Header',
10+
component: Header,
11+
parameters: {
12+
layout: 'fullscreen',
13+
},
14+
tags: ['autodocs'],
15+
decorators: [
16+
(Story) => (
17+
<MemoryRouter>
18+
<Story />
19+
</MemoryRouter>
20+
),
21+
],
22+
argTypes: {
23+
title: { control: 'text' },
24+
leftBtn: { control: false },
25+
rightBtn: { control: false },
26+
withBack: { control: 'boolean' },
27+
withSpacer: { control: 'boolean' },
28+
transparent: { control: 'boolean' },
29+
},
30+
};
31+
32+
export default meta;
33+
type Story = StoryObj<typeof Header>;
34+
35+
export const Default: Story = {
36+
args: {
37+
title: '페이지 타이틀',
38+
withSpacer: false,
39+
},
40+
};
41+
42+
export const Transparent: Story = {
43+
args: {
44+
...Default.args,
45+
transparent: true,
46+
},
47+
parameters: {
48+
backgrounds: {
49+
default: 'dark',
50+
},
51+
},
52+
};
53+
54+
export const WithBack: Story = {
55+
args: {
56+
...Default.args,
57+
withBack: true,
58+
},
59+
};
60+
61+
export const WithRightButton: Story = {
62+
args: {
63+
...Default.args,
64+
rightBtn: (
65+
<button className="px-4" aria-label="label" type="button">
66+
<Search />
67+
</button>
68+
),
69+
},
70+
};

src/components/Header/index.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type HeaderProps = {
99
transparent?: boolean;
1010
};
1111

12-
const Header = ({
12+
export const Header = ({
1313
title,
1414
leftBtn,
1515
rightBtn,
@@ -20,20 +20,18 @@ const Header = ({
2020
const transparentClass = transparent ? 'bg-transparent' : 'bg-neutral-0';
2121
return (
2222
<>
23-
<div
24-
className={`fixed z-header grid h-header w-full max-w-mobile grid-cols-[1fr_auto_1fr] items-center pt-safe-top ${transparentClass}`}
25-
>
26-
<div className="flex justify-start">
27-
{withBack && <BackButton />}
28-
{leftBtn}
23+
<div className={`fixed z-header w-full max-w-mobile pt-safe-top ${transparentClass}`}>
24+
<div className="grid h-header grid-cols-[1fr_auto_1fr] items-center">
25+
<div className="flex justify-start">
26+
{withBack && <BackButton />}
27+
{leftBtn}
28+
</div>
29+
<h1 className="truncate px-2 text-center text-body1">{title}</h1>
30+
<div className="flex justify-end">{rightBtn}</div>
2931
</div>
30-
<h1 className="truncate px-2 text-center text-body1">{title}</h1>
31-
<div className="flex justify-end">{rightBtn}</div>
3232
</div>
3333

3434
{withSpacer && <div className="mt-safe-top h-header" />}
3535
</>
3636
);
3737
};
38-
39-
export default Header;

src/pages/Main/index.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
import { BookCase } from 'components/BookCase';
2-
import Header from 'components/Header';
2+
import { Searchbar } from 'components/Searchbar';
33

4+
const MSG_TITLE_SEARCH_PLACEHOLDER = '책 제목을 입력해주세요';
45
const Main = () => {
56
return (
6-
<>
7-
<Header withSpacer={false} title="타이틀" rightBtn={<button aria-label="기간선택" type="button" />} />
8-
<div className="flex h-dvh flex-col items-center justify-center overflow-scroll">
7+
<div className="relative h-dvh overflow-scroll bg-secondary pt-safe-top">
8+
<div className="relative z-10 h-full px-mobile">
9+
<Searchbar value="" onChange={() => {}} onSubmit={() => {}} placeholder={MSG_TITLE_SEARCH_PLACEHOLDER} />
10+
<p className="mt-4 text-title1">2025년 전체 책장</p>
11+
<p className="mb-[1.375rem] text-body1 text-neutral-60">45권 채웠습니다</p>
912
<BookCase />
1013
</div>
11-
</>
14+
15+
<div className="absolute inset-0 bg-neutral-0 mix-blend-soft-light" />
16+
<div className="absolute bottom-0 h-48 w-full bg-[linear-gradient(180deg,_#A6D68E_0%,_rgba(255,255,255,0)_100%)]" />
17+
</div>
1218
);
1319
};
1420

src/router.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const WithoutBottomNavLayout = lazy(() => import('pages/Layout/WithoutBottomNavL
2020
// const Note = lazy(() => import('pages/Note'));
2121
const PrivateRoute = lazy(() => import('pages/PrivateRoute'));
2222
// const Record = lazy(() => import('pages/Record'));
23-
const Search = lazy(() => import('pages/Search'));
23+
// const Search = lazy(() => import('pages/Search'));
2424
// const SignUp = lazy(() => import('pages/SignUp'));
2525

2626
const router = createBrowserRouter([
@@ -35,8 +35,8 @@ const router = createBrowserRouter([
3535
{
3636
element: <WithBottomNavLayout />,
3737
children: [
38-
// { path: '/', element: <Main /> },
39-
{ path: '/', element: <Search /> },
38+
{ path: '/', element: <Main /> },
39+
// { path: '/', element: <Search /> },
4040
// { path: 'library', element: <Library /> },
4141
// { path: 'myPage', element: <MyPage /> },
4242
// { path: 'detail/:detailId', element: <BookDetail /> },

0 commit comments

Comments
 (0)