Skip to content

Commit

Permalink
Merge pull request #248 from gloddy-dev/feature/240-refactoring-grouping
Browse files Browse the repository at this point in the history
Fix : 그루핑, 나의 모임 페이지 오류 수정
  • Loading branch information
guesung authored Aug 19, 2023
2 parents 4d218da + 3c0bd18 commit 6a02581
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function GroupingCardList() {
const { data } = useGetGroups();

return (
<section className="mx-20 flex flex-col gap-8">
<section className="flex flex-col gap-8">
{data.map((groupingData) => (
<GroupingCard groupingData={groupingData} key={groupingData.groupId} />
))}
Expand Down
8 changes: 4 additions & 4 deletions src/app/(main)/grouping/util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function formatDate(input: string): string {
const [datePart, timePart] = input.split(' ');
const [month, day, weekday] = datePart.split('.');
const [time, ampm] = timePart.split(/(AM|PM)/);
return `${month}.${day} ${weekday} ${time}${ampm}`;
const day = input.split(' ')[1];
const month = input.split(' ')[0].substr(5, 2);
const date = input.split(' ')[0].substr(8, 2);
return `${month}.${date} ${day}`;
}
4 changes: 2 additions & 2 deletions src/components/Card/GroupingCard.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ export default function GroupingCard({
{place}
</div>
<Spacing size={4} />
<p className="flex text-caption text-sign-tertiary">
<div className="flex text-caption text-sign-tertiary">
<Image src="/icons/16/date_range.svg" width={16} height={16} alt="location" />
<Spacing size={4} direction="horizontal" />
{formatDate(meetDate)}
</p>
</div>
</section>
</Flex>
{children}
Expand Down
12 changes: 0 additions & 12 deletions src/components/Tabs/Tabs.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ import {
import type { StrictPropsWithChildren } from '@/types';

export default function Tabs({ children }: StrictPropsWithChildren) {
const validListChildren = Children.toArray(children).filter((child) =>
isValidElement(child)
) as ReactElement[];
const validPanelChildren = Children.toArray(children).filter((child) =>
isValidElement(child)
) as ReactElement[];

if (validListChildren.length !== 1) throw new Error('List 컴포넌트는 1개이어야 합니다.');

if (validListChildren[0].props.children.length !== validPanelChildren.length)
throw new Error('Panel 컴포넌트는 Tab개수와 동일해야 합니다. ');

return <>{children}</>;
}

Expand Down

0 comments on commit 6a02581

Please sign in to comment.