Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ const config: StorybookConfig = {
],
framework: {
name: '@storybook/nextjs',
options: {},
options: {
method: 'alphabetical',

storySort: {},
},
},
};

Expand Down
14 changes: 14 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,18 @@ export const parameters = {
nextjs: {
appDirectory: true,
},
options: {
storySort: {
method: 'alphabetical',
order: [
'common',
['button', 'calendar', 'image', 'input'],
'layout',
'auth',
'crew',
'gathering',
'review',
],
},
},
};
1 change: 0 additions & 1 deletion src/_apis/crew/crew.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
CreateCrewRequestTypes,
CreateCrewResponseTypes,
EditCrewRequestTypes,
EditCrewResponseTypes,
} from '@/src/types/create-crew';

export async function createCrew(data: CreateCrewRequestTypes) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/(auth)/login/_component/login-form.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Meta, StoryFn } from '@storybook/react';
import LoginForm, { LoginFormValues } from './login-form';

const meta: Meta = {
title: 'Components/auth/LoginForm',
title: 'auth/login-form',
component: LoginForm,
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/(auth)/signup/_component/signup-form.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Meta, StoryFn } from '@storybook/react';
import SignupForm, { SignupFormValues } from './signup-form';

const meta: Meta = {
title: 'Components/auth/SignupForm',
title: 'auth/signup-form',
component: SignupForm,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import categoryData from '@/src/data/category.json';
import InternalCategory, { InternalCategoryProps } from '.';

const meta: Meta = {
title: 'Components/category/internal-category',
title: 'layout/category',
component: InternalCategory,
tags: ['autodocs'],
argTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const initialValue: CreateCrewRequestTypes = {
};

export default {
title: 'forms/create-crew-form',
title: 'crew/create-crew-form',
component: CreateCrewForm,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const initialValue: CreateGatheringFormTypes = {
};

export default {
title: 'forms/create-gathering-form',
title: 'gathering/create-gathering-form',
component: CreateGatheringForm,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CrewReviewData } from '@/src/mock/review-data';
import CrewReviewList from './crew-review-list';

const meta: Meta<typeof CrewReviewList> = {
title: 'Components/Detail/CrewReviewList',
title: 'crew/crew-review-list',
component: CrewReviewList,
parameters: {
layout: 'fulled',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import DetailCrewPresenter from './detail-crew-presenter';

const meta: Meta<typeof DetailCrewPresenter> = {
title: 'Components/Detail/DetailCrewPresenter',
title: 'crew/crew-detail',
component: DetailCrewPresenter,
parameters: {
layout: 'fullscreen',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Meta, StoryFn } from '@storybook/react';
import GatheringDetailModalContainer, { GatheringDetailModalContainerProps } from './container';

const meta: Meta = {
title: 'components/gathering-detail-modal',
title: 'gathering/gathering-detail-modal',
component: GatheringDetailModalContainer,
argTypes: {
opened: { control: 'boolean' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Meta, StoryFn } from '@storybook/react';
import RatingDisplay, { ReviewRateInfo } from './rating-display';

export default {
title: 'Components/Detail/RatingDisplay',
title: 'crew/crew-rating-display',
component: RatingDisplay,
tags: ['autodocs'],
argTypes: {
Expand Down
2 changes: 1 addition & 1 deletion src/app/(crew)/crew/detail/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import IcoCreateCrew from '@/public/assets/icons/ic-create-crew.svg';

export default function EditCrewPage() {
const { id } = useParams();
const { data, isLoading, error } = useGetCrewDetailQuery(Number(id));
const { data, isLoading } = useGetCrewDetailQuery(Number(id));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โš ๏ธ Potential issue

์—๋Ÿฌ ์ฒ˜๋ฆฌ ๋กœ์ง์ด ๋ˆ„๋ฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค

useGetCrewDetailQuery์—์„œ ์—๋Ÿฌ ์ฒ˜๋ฆฌ๊ฐ€ ์ œ๊ฑฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ fetching ์‹คํŒจ ์‹œ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ ์ ˆํ•œ ํ”ผ๋“œ๋ฐฑ์„ ์ œ๊ณตํ•˜์ง€ ๋ชปํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ์—๋Ÿฌ ์ฒ˜๋ฆฌ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค:

- const { data, isLoading } = useGetCrewDetailQuery(Number(id));
+ const { data, isLoading, error } = useGetCrewDetailQuery(Number(id));
+ if (error) {
+   return (
+     <div className="fixed inset-0 flex items-center justify-center">
+       <p className="text-red-500">๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š”๋ฐ ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด ์ฃผ์„ธ์š”.</p>
+     </div>
+   );
+ }
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { data, isLoading } = useGetCrewDetailQuery(Number(id));
const { data, isLoading, error } = useGetCrewDetailQuery(Number(id));
if (error) {
return (
<div className="fixed inset-0 flex items-center justify-center">
<p className="text-red-500">๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š”๋ฐ ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด ์ฃผ์„ธ์š”.</p>
</div>
);
}

const { isPending, mutate } = useEditCrewQuery(Number(id));
if (data === undefined) return null;

Expand Down
1 change: 0 additions & 1 deletion src/app/(crew)/my-crew/hosted/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client';

import { Loader } from '@mantine/core';
import { useGetMyCrewHostedQuery } from '@/src/_queries/crew/my-crew-hosted-list-query';
import { useInfiniteScroll } from '@/src/hooks/use-infinite-scroll';
import CrewCardList from '@/src/components/common/crew-list/crew-card-list';
Expand Down
1 change: 0 additions & 1 deletion src/app/(crew)/my-crew/joined/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client';

import { Loader } from '@mantine/core';
import { useGetMyCrewJoinedQuery } from '@/src/_queries/crew/my-crew-joined-list-query';
import { useInfiniteScroll } from '@/src/hooks/use-infinite-scroll';
import CrewCardList from '@/src/components/common/crew-list/crew-card-list';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
import { useEffect, useState } from 'react';
import { toast } from 'react-toastify';
import { useRouter } from 'next/navigation';
import {
fetchUpdatedUser,
resetUserProfileImage,
updateUserProfile,
} from '@/src/_apis/auth/user-apis';
import { resetUserProfileImage, updateUserProfile } from '@/src/_apis/auth/user-apis';
import { useUser } from '@/src/_queries/auth/user-queries';
import { useAuth } from '@/src/hooks/use-auth';
import ProfileSkeleton from '@/src/components/common/skeleton/profile-skeleton';
Expand Down
2 changes: 1 addition & 1 deletion src/app/(crew)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useRef, useState } from 'react';
import Image from 'next/image';
import { Divider, Loader, Skeleton, TextInput } from '@mantine/core';
import { Divider, TextInput } from '@mantine/core';
import { useGetCrewListQuery } from '@/src/_queries/crew/crew-list-queries';
import regionData from '@/src/data/region.json';
import { useInfiniteScroll } from '@/src/hooks/use-infinite-scroll';
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/crew-list/crew-card-list.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ClientProvider from '@/src/components/client-provider';
import CrewCardList from './crew-card-list';

const meta: Meta = {
title: 'Components/CrewCardList/CrewCardList',
title: 'crew/crew-card-list',
component: CrewCardList,
parameters: {
layout: 'fullscreen',
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/crew-list/profiles.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import Profiles from './profiles';

const meta: Meta = {
title: 'Components/CrewCardList/Profiles',
title: 'crew/crew-profiles',
component: Profiles,
parameters: {
layout: 'centered',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import GatheringCard from './container';
const queryClient = new QueryClient();

const meta: Meta<typeof GatheringCard> = {
title: 'Components/GatheringCard',
title: 'gathering/gathering-card',
component: GatheringCard,
parameters: {
layout: 'fullscreen',
Expand Down
1 change: 0 additions & 1 deletion src/components/common/gathering-card/presenter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { MouseEvent } from 'react';
import Image from 'next/image';
import { Badge } from '@mantine/core';
import { cn } from '@/src/utils/cn';
import { formatDate } from '@/src/utils/format-date';
import Button from '@/src/components/common/input/button';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Image from 'next/image';
import { Badge } from '@mantine/core';
import { formatDate } from '@/src/utils/format-date';
import { GatheringCardProps } from '@/src/types/gathering-data';
import IcoPerson from '@/public/assets/icons/ic-gathering-person.svg';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ClientProvider from '@/src/components/client-provider';
import ScheduledGatheringCard from './container';

const meta: Meta<typeof ScheduledGatheringCard> = {
title: 'Components/ScheduledGatheringCard',
title: 'gathering/scheduled-gathering-card',
component: ScheduledGatheringCard,
parameters: {
layout: 'fullscreen',
Expand Down
6 changes: 2 additions & 4 deletions src/components/common/header/header.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { useState } from 'react';
import type { Meta, StoryFn } from '@storybook/react';
import { QueryClient, QueryClientProvider, useQueryClient } from '@tanstack/react-query';
import { useAuth } from '@/src/hooks/use-auth';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import Header from '@/src/components/common/header/container';

const meta: Meta = {
title: 'Components/Header',
title: 'layout/header',
component: Header,
tags: ['autodocs'],
parameters: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/input/button/button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Meta, StoryFn } from '@storybook/react';
import Button, { ButtonProps } from './index';

const meta: Meta = {
title: 'Components/Button',
title: 'common/button/button',
tags: ['autodocs'],
component: Button,
argTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Meta } from '@storybook/react';
import FloatingButton, { FloatingButtonProps } from './floating-btn';

const meta: Meta<typeof FloatingButton> = {
title: 'Components/FloatingButton',
title: 'common/button/floating-button',
component: FloatingButton,
tags: ['autodocs'],
argTypes: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/input/button/like-btn.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 LikeBtn from './like-btn';

const meta: Meta<typeof LikeBtn> = {
title: 'Components/LikeBtn',
title: 'common/button/like-button',
component: LikeBtn,
tags: ['autodocs'],
argTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const mockData = [
];

const meta: Meta = {
title: 'Components/input/calendar-filter',
title: 'common/calendar/calendar-filter',
component: CalendarFilter,
tags: ['autodocs'],
argTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Meta, StoryFn } from '@storybook/react';
import DateTimePicker, { DateTimePickerProps } from '.';

const meta: Meta = {
title: 'Components/input/date-time-picker',
title: 'common/calendar/date-time-picker',
component: DateTimePicker,
tags: ['autodocs'],
argTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Meta, StoryFn } from '@storybook/react';
import DropDown, { DropDownProps } from '.';

const meta: Meta = {
title: 'Components/input/drop-down',
title: 'common/drop-down',
component: DropDown,
tags: ['autodocs'],
argTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Meta, StoryFn } from '@storybook/react';
import FileInput, { FileInputProps } from '.';

const meta: Meta = {
title: 'Components/input/file-input',
title: 'common/image/image-input',
component: FileInput,
tags: ['autodocs'],
argTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ImgCrewSampleUrls from '@/public/assets/images/crew-sample';
import FileSample, { FileSampleProps } from '.';

const meta: Meta = {
title: 'Components/input/file-sample',
title: 'common/image/image-sample',
component: FileSample,
argTypes: {
image: {
Expand All @@ -26,12 +26,12 @@ const meta: Meta = {
export default meta;

const Template: StoryFn<FileSampleProps> = function FileInputStory(args: FileSampleProps) {
const [selectedFile, setSelectedFile] = useState<string | null>(null);
const [isBlur, setIsBlur] = useState(false);

const handleFileChange = (file: string | null) => {
setSelectedFile(file);
setIsBlur(false); // ํŒŒ์ผ ์„ ํƒ ์‹œ ๋ธ”๋Ÿฌ ํ•ด์ œ
if (file) {
setIsBlur(false); // ํŒŒ์ผ ์„ ํƒ ์‹œ ๋ธ”๋Ÿฌ ํ•ด์ œ
}
};

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useRef } from 'react';
import Image, { StaticImageData } from 'next/image';
import Image from 'next/image';

export interface FileSampleProps {
isEdit?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Meta, StoryFn } from '@storybook/react';
import PasswordInput, { PasswordInputProps } from '.';

const meta: Meta = {
title: 'Components/input/password-input',
title: 'common/input/password-input',
component: PasswordInput,
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/input/pop-over-calendar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export interface PopOverProps {

export default function PopOverCalendar({ value, onChange }: PopOverProps) {
const [opened, { open, close }] = useDisclosure();
const [inputTheme, setInputTheme] = useState(opened ? 'dark' : 'light');
const [date, setDate] = useState<Date>(value);
const isMobile = useMediaQuery(`(max-width: ${theme.breakpoints.md})`);
const popOver = useRef<HTMLDivElement>(null);
const inputTheme = opened ? 'dark' : 'light';

const handleClear = (e: React.MouseEvent<HTMLButtonElement>) => {
e.stopPropagation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Meta, StoryFn } from '@storybook/react';
import TextInput, { TextInputProps } from '.';

const meta: Meta = {
title: 'Components/input/text-input',
title: 'common/input/text-input',
component: TextInput,
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/input/textarea/textarea.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Meta, StoryFn } from '@storybook/react';
import Textarea, { TextareaProps } from '.';

const meta: Meta = {
title: 'Components/input/textarea',
title: 'common/input/textarea',
component: Textarea,
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/profile/Profile.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 { Profile } from './index';

const meta: Meta<typeof Profile> = {
title: 'Components/Profile',
title: 'common/profile',
component: Profile,
parameters: {
layout: 'centered',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Meta, StoryFn } from '@storybook/react';
import ProgressBar, { ProgressBarProps } from './index';

const meta: Meta<typeof ProgressBar> = {
title: 'Components/ProgressBar',
title: 'common/progress-bar',
component: ProgressBar,
tags: ['autodocs'],
argTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MyReviewData } from '@/src/mock/review-data';
import ReviewCardList from './review-card-list';

const meta: Meta<typeof ReviewCardList> = {
title: 'components/ReviewCardList',
title: 'review/review-card-list',
component: ReviewCardList,
parameters: {
layout: 'fullscreen',
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/tab/tab.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import tabData from '@/src/data/tab.json';
import Tabs, { TabsProps } from './index';

const meta: Meta = {
title: 'Components/Tabs',
title: 'layout/tabs',
component: Tabs,
tags: ['autodocs'],
argTypes: {
Expand Down
Loading
Loading