Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e2b7db4
โœจ [Feature] ๋‚˜์˜ ๋ชจ์ž„ ์นด๋“œ ๊ตฌํ˜„ (#142)
cloud0406 Dec 12, 2024
27d525b
โœจ[Feat] ๋ชจ์ž„๋ฉ”์ธํŽ˜์ด์ง€ Header UI ์ƒ์„ฑ #132
wynter24 Dec 12, 2024
5f80c91
๋ผ์ธ ์—”๋”ฉ ์ •๊ทœํ™”: .gitattributes ์„ค์ • ๋ฐ˜์˜
wynter24 Dec 12, 2024
4830624
๐Ÿ›[Fix] normalize line endings #72
wynter24 Dec 12, 2024
15291ec
โœจ[Feat] ๋ชจ์ž„๋ฉ”์ธํŽ˜์ด์ง€ Header UI ์ƒ์„ฑ #132
wynter24 Dec 12, 2024
72e44e7
Merge branch '132-feature-๋ชจ์ž„-๋ฉ”์ธํŽ˜์ด์ง€-ui' of https://github.com/codeit-tโ€ฆ
wynter24 Dec 12, 2024
103597b
๐Ÿ›[Fix] DropDown, SortingButton ์ปดํฌ๋„ŒํŠธ์— use client ์ถ”๊ฐ€ #132
wynter24 Dec 12, 2024
3bbfb03
โœจ[Feat] ๋ฐ˜์‘ํ˜• ๊ตฌํ˜„ #132
wynter24 Dec 12, 2024
e04aad8
โ™ป๏ธ[Refactor] ๋ฒ„ํŠผ ์ปดํฌ๋„ŒํŠธ ๋ฆฌํŒฉํ† ๋ง #143 (#144)
sunnwave Dec 12, 2024
9c1ca01
๐Ÿ›[Fix] Card ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ์— use client ์ถ”๊ฐ€ #132
wynter24 Dec 12, 2024
c17c098
โœจ[Feat] ์ฑ…๋ชจ์ž„ Mian ์ปดํฌ๋„ŒํŠธ ์ƒ์„ฑ #132
wynter24 Dec 12, 2024
10eb4ae
โœจ[Feat] ์ฑ…๋ชจ์ž„ FilterBaR ์ปดํฌ๋„ŒํŠธ ์ƒ์„ฑ #132
wynter24 Dec 12, 2024
7db8598
โ™ป๏ธ[Refactor] ์ „์ฒด ๊ตฌ์กฐ ๊ฐœ์„  #132
wynter24 Dec 12, 2024
344c20f
๋ผ์ธ ์—”๋”ฉ ์ •๊ทœํ™”: .gitattributes ์„ค์ • ๋ฐ˜์˜
wynter24 Dec 12, 2024
8310dc7
๐Ÿ›[Fix] normalize line endings #72
wynter24 Dec 12, 2024
4b8b3cd
โœจ[Feat] ๋ชจ์ž„๋ฉ”์ธํŽ˜์ด์ง€ Header UI ์ƒ์„ฑ #132
wynter24 Dec 12, 2024
9080a70
Fix: Resolve merge conflicts in package-lock.json during rebase
wynter24 Dec 12, 2024
f232275
โœจ[Feat] ๋ชจ์ž„๋ฉ”์ธํŽ˜์ด์ง€ Header UI ์ƒ์„ฑ #132
wynter24 Dec 12, 2024
272a29a
๐Ÿ›[Fix] DropDown, SortingButton ์ปดํฌ๋„ŒํŠธ์— use client ์ถ”๊ฐ€ #132
wynter24 Dec 12, 2024
f4b8144
โœจ[Feat] ๋ฐ˜์‘ํ˜• ๊ตฌํ˜„ #132
wynter24 Dec 12, 2024
6120df0
๐Ÿ›[Fix] Card ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ์— use client ์ถ”๊ฐ€ #132
wynter24 Dec 12, 2024
af9150e
โœจ[Feat] ์ฑ…๋ชจ์ž„ Mian ์ปดํฌ๋„ŒํŠธ ์ƒ์„ฑ #132
wynter24 Dec 12, 2024
6c0afd9
โœจ[Feat] ์ฑ…๋ชจ์ž„ FilterBaR ์ปดํฌ๋„ŒํŠธ ์ƒ์„ฑ #132
wynter24 Dec 12, 2024
c490ad9
โ™ป๏ธ[Refactor] ์ „์ฒด ๊ตฌ์กฐ ๊ฐœ์„  #132
wynter24 Dec 12, 2024
48bb6a5
Merge branch '132-feature-๋ชจ์ž„-๋ฉ”์ธํŽ˜์ด์ง€-ui' of https://github.com/codeit-tโ€ฆ
wynter24 Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38,192 changes: 19,096 additions & 19,096 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/app/bookclub/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// import BookClubMainPage from '@/features/bookclub/components/BookClubMainPage';
import { BookClubMainPage } from '@/features/bookclub/components';

export default function Home() {
return <div className="-mx-4 md:-mx-6 lg:-mx-10"></div>;
return (
<>
<BookClubMainPage />
</>
);
}
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export default function RootLayout({
}>) {
return (
<html lang="ko">
<body className="min-h-screen bg-gray-100">
<body className="min-h-screen bg-white">
<ReactQueryProviders>
<HeaderBar />
<main className="mx-auto min-h-screen max-w-[1200px] bg-gray-50 px-4 pt-[56px] md:px-6 lg:px-10">
<main className="mx-auto min-h-screen max-w-[1200px] bg-white pt-[56px]">
{children}
</main>
</ReactQueryProviders>
Expand Down
27 changes: 18 additions & 9 deletions src/components/button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,20 @@ const meta = {
export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
export const Solid: Story = {
args: {
text: 'ํ™•์ธ',
size: 'medium',
fillType: 'solid',
themeColor: 'green-normal-01',
},
};

export const Small: Story = {
export const Outline: Story = {
args: {
text: 'ํ™•์ธ',
size: 'small',
size: 'medium',
fillType: 'outline',
themeColor: 'green-light-03',
themeColor: 'green-normal-01',
},
};

Expand All @@ -35,7 +34,16 @@ export const LightSolid: Story = {
text: 'ํ™•์ธ',
size: 'modal',
fillType: 'lightSolid',
themeColor: 'gray-normal-03',
themeColor: 'green-normal-01',
lightColor: 'green-light-03',
},
};
export const Small: Story = {
args: {
text: 'ํ™•์ธ',
size: 'small',
fillType: 'outline',
themeColor: 'green-light-03',
},
};

Expand All @@ -58,10 +66,11 @@ export const Submitting: Story = {

export const Disabled: Story = {
args: {
text: 'ํ™•์ธ',
text: '์ƒ์„ฑํ•˜๊ธฐ',
size: 'large',
fillType: 'solid',
themeColor: 'gray-darker',
fillType: 'lightSolid',
themeColor: 'gray-dark-01',
lightColor: 'gray-normal-01',
disabled: true,
},
parameters: {
Expand Down
45 changes: 12 additions & 33 deletions src/components/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import React from 'react';
import { twMerge } from 'tailwind-merge';
import { BASE_CLASSES, COLOR_GROUPS, SIZE } from '@/constants';
import { COLOR_SCHEMES, SIZE } from '@/constants';

interface ButtonProps extends React.ComponentPropsWithoutRef<'button'> {
text: string;
size: 'large' | 'medium' | 'small' | 'modal';
fillType: 'solid' | 'outline' | 'lightSolid' | 'lightOutline';
themeColor:
| 'green-normal-01'
| 'green-light-03'
| 'gray-normal-03'
| 'gray-normal-02'
| 'gray-darker';
fillType: 'solid' | 'outline' | 'lightSolid';
themeColor: keyof typeof COLOR_SCHEMES;
lightColor?: keyof typeof COLOR_SCHEMES;
isSubmitting?: boolean;
}

Expand All @@ -20,6 +16,7 @@ export default function Button({
size,
fillType = 'solid',
themeColor = 'green-normal-01',
lightColor,
isSubmitting,
...buttonProps
}: ButtonProps) {
Expand All @@ -36,35 +33,17 @@ export default function Button({
: themeColor;

const variantClasses = (() => {
const color = COLOR_GROUPS[resolvedColor];

type TextClassType =
| 'text-green-normal-01'
| 'text-gray-darker'
| 'text-white'
| 'text-gray-dark-02';

let textClass: TextClassType = color.text;

// ๋ฐฐ๊ฒฝ์ƒ‰๊ณผ ๊ธ€์ž์ƒ‰์ด ๋™์ผํ•œ ๊ฒฝ์šฐ textClass๋ฅผ ํฐ์ƒ‰์œผ๋กœ ๋ฎ์–ด์“ฐ๊ธฐ
if (
(fillType === 'lightSolid' || fillType === 'lightOutline') &&
color.bg.includes(color.text.replace('text-', 'bg-'))
) {
textClass = 'text-white';
}

switch (fillType) {
case 'solid':
return `${color.bg} ${BASE_CLASSES.solid}`;
return `text-gray-white ${COLOR_SCHEMES[resolvedColor]['bg']}`;
case 'outline':
return `${BASE_CLASSES.outline} ${color.text} ${color.border}`;
return `bg-gray-white border ${COLOR_SCHEMES[resolvedColor]['text']} ${COLOR_SCHEMES[resolvedColor]['border']}`;
case 'lightSolid':
return `${color.bg} ${textClass}`;
case 'lightOutline':
return `${BASE_CLASSES.lightOutline} ${color.bg} ${textClass} ${color.border}`;
default:
throw new Error(`์ž˜๋ชป๋œ fillType ๊ฐ’์ž…๋‹ˆ๋‹ค: ${fillType}`);
if (lightColor) {
return `${COLOR_SCHEMES[resolvedColor]['text']} ${COLOR_SCHEMES[lightColor]['bg']}`;
} else {
return `${COLOR_SCHEMES[resolvedColor]['text']} bg-gray-white`;
}
}
})();

Expand Down
2 changes: 2 additions & 0 deletions src/components/card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { createContext, useContext } from 'react';
import Chip from '@/components/chip/Chip';
import ParticipantCounter from '../participant-counter/ParticipantCounter';
Expand Down
79 changes: 79 additions & 0 deletions src/components/card/my-club-card/MyClubCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import type { Meta, StoryObj } from '@storybook/react';
import MyClubCard from './MyClubCard';

const meta = {
title: 'Components/Card/MyClubCard',
component: MyClubCard,
parameters: {
layout: 'centered',
},
} satisfies Meta<typeof MyClubCard>;

export default meta;
type Story = StoryObj<typeof MyClubCard>;

const mockClubMeeting = {
meetingInfo: {
title: '์„์ง€๋กœ์—์„œ ๋งŒ๋‚˜๋Š” ๋…์„œ ๋ชจ์ž„',
location: '์„์ง€๋กœ 3๊ฐ€',
datetime: '12/14(ํ† ) ์˜ค์ „ 10:00',
category: '์ž์œ ์ฑ…',
},
imageInfo: {
url: 'https://picsum.photos/seed/bookclub/800/450',
isLiked: true,
onLikeClick: () => alert('์ข‹์•„์š”๋ฅผ ๋ˆŒ๋ €์Šต๋‹ˆ๋‹ค!'),
},
clubStatus: {
isCompleted: false,
isConfirmed: true,
},
actions: {
onClick: () => alert('์นด๋“œ๋ฅผ ํด๋ฆญํ–ˆ์Šต๋‹ˆ๋‹ค!'),
onDelete: () => alert('๋ชจ์ž„์„ ์‚ญ์ œํ–ˆ์Šต๋‹ˆ๋‹ค!'),
},
};

export const Default: Story = {
args: {
meeting: mockClubMeeting,
},
render: (args) => (
<div className="w-[344px]">
<MyClubCard {...args} />
</div>
),
};

export const Completed: Story = {
args: {
meeting: {
...mockClubMeeting,
clubStatus: {
...mockClubMeeting.clubStatus,
isCompleted: true,
},
},
},
};

export const Pending: Story = {
args: {
meeting: {
...mockClubMeeting,
clubStatus: {
...mockClubMeeting.clubStatus,
isConfirmed: false,
},
},
},
};

export const Canceled: Story = {
args: {
meeting: {
...mockClubMeeting,
isCanceled: true,
},
},
};
68 changes: 68 additions & 0 deletions src/components/card/my-club-card/MyClubCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { ComponentPropsWithoutRef } from 'react';
import Card from '../Card';
import ClubChip from '@/components/chip/club-chip/ClubChip';
import Button from '@/components/button/Button';
import { ClubMeeting } from '@/components/card/types';
import Chip from '@/components/chip/Chip';

interface MyClubCardProps extends ComponentPropsWithoutRef<'article'> {
meeting: ClubMeeting;
}

function MyClubCard({ meeting, className, ...props }: MyClubCardProps) {
const {
meetingInfo,
imageInfo,
clubStatus,
isCanceled = false,
actions,
} = meeting;

return (
<Card isCanceled={isCanceled} className={className} {...props}>
<div className="flex flex-col gap-4">
<Card.Image {...imageInfo} />
<Card.Box className="relative flex-1" onClick={actions?.onClick}>
{/* ์ฒซ ๋ฒˆ์งธ ์ค„: ClubChip + Chip */}
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<ClubChip
variant={clubStatus.isCompleted ? 'completed' : 'scheduled'}
/>
<ClubChip
variant={clubStatus.isConfirmed ? 'confirmed' : 'pending'}
/>
</div>
<Chip text={meetingInfo.category} />
</div>

{/* ๋‘ ๋ฒˆ์งธ ์ค„: ๋ชจ์ž„ ์ •๋ณด */}
<div className="mt-4">
<h3 className="text-xl font-semibold text-gray-black">
{meetingInfo.title}
</h3>
<div className="mt-1 flex items-center gap-1.5 text-sm text-gray-dark-03">
<span>{meetingInfo.location}</span>
<span>{meetingInfo.datetime}</span>
</div>
</div>

{/* ์„ธ ๋ฒˆ์งธ ์ค„: ๋ฒ„ํŠผ */}
<div className="mt-4">
<Button
text="์ฐธ์—ฌ ์ทจ์†Œํ•˜๊ธฐ"
size="medium"
fillType="outline"
themeColor="green-normal-01"
onClick={actions?.onDelete}
/>
</div>

<Card.EndedOverlay onDelete={actions?.onDelete} />
</Card.Box>
</div>
</Card>
);
}

export default MyClubCard;
12 changes: 12 additions & 0 deletions src/components/card/types/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@ export interface FullMeeting extends Omit<Meeting, 'actions'> {
hostInfo: HostInfo;
actions: FullActions;
}

export interface ClubStatus {
isCompleted: boolean;
isConfirmed: boolean;
}

export interface ClubMeeting extends BaseProps {
meetingInfo: MeetingInfo;
imageInfo: ImageInfo;
clubStatus: ClubStatus;
actions: SimpleActions;
}
8 changes: 4 additions & 4 deletions src/components/chip/Chip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import Chip from './Chip';

const meta = {
title: 'Components/Chip',
title: 'Components/Chip/Base',
component: Chip,
parameters: {
layout: 'centered',
Expand All @@ -29,7 +29,7 @@ export const RoundedLight: Story = {
export const SquareOutlined: Story = {
args: {
text: '์˜คํ”„๋ผ์ธ',
variant: 'square-light',
variant: 'square-outlined',
},
};

Expand All @@ -54,13 +54,13 @@ export const AllStates: Story = {
<div className="flex gap-2">
<Chip text="๋ชจ์ง‘์ค‘" variant="rounded-filled" />
<Chip text="1์›” 7์ผ" variant="rounded-light" />
<Chip text="์˜คํ”„๋ผ์ธ" variant="square-light" />
<Chip text="์˜คํ”„๋ผ์ธ" variant="square-outlined" />
<Chip text="๋งˆ๊ฐ" variant="square-filled" />
</div>
<div className="flex gap-2">
<Chip text="์ž์œ ์ฑ…" variant="rounded-filled" isPast={true} />
<Chip text="1์›” 7์ผ" variant="rounded-light" isPast={true} />
<Chip text="์˜คํ”„๋ผ์ธ" variant="square-light" isPast={true} />
<Chip text="์˜คํ”„๋ผ์ธ" variant="square-outlined" isPast={true} />
<Chip text="๋งˆ๊ฐ" variant="square-filled" isPast={true} />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/chip/Chip.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Chip from '@/components/chip/Chip';
import '@testing-library/jest-dom';
import { render, screen } from '@testing-library/react';

describe('TextChip', () => {
describe('Chip', () => {
it('ํ…์ŠคํŠธ๊ฐ€ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๋ Œ๋”๋ง๋˜์–ด์•ผ ํ•œ๋‹ค', () => {
render(<Chip text="ํ…Œ์ŠคํŠธ" />);
const chip = screen.getByText('ํ…Œ์ŠคํŠธ');
Expand Down
14 changes: 8 additions & 6 deletions src/components/chip/Chip.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { twMerge } from 'tailwind-merge';

const CHIP_VARIANTS = {
'rounded-filled': 'rounded-full bg-green-light-02 text-green-dark-01',
'rounded-light': 'rounded-full bg-green-normal-01 text-gray-white',
'square-light':
'rounded border border-gray-normal-02 bg-gray-light-01 text-gray-dark-01',
'square-filled': 'rounded bg-green-dark-01 text-gray-dark-01',
'rounded-filled':
'rounded-full bg-green-light-02 text-green-dark-01 font-semibold',
'rounded-light':
'rounded-full bg-green-normal-01 text-gray-white font-semibold',
'square-outlined':
'rounded-md border border-green-normal-01 bg-gray-white text-green-normal-01',
'square-filled': 'rounded-md bg-green-normal-01 text-gray-white px-2',
} as const;

type ChipVariant = keyof typeof CHIP_VARIANTS;
Expand All @@ -24,7 +26,7 @@ function Chip({
className,
}: ChipProps) {
const baseStyles =
'inline-flex items-center justify-center px-2.5 py-1 text-sm font-semibold';
'inline-flex items-center justify-center px-2.5 py-1 text-sm font-medium';

const combinedClassName = twMerge(
baseStyles,
Expand Down
Loading
Loading