Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial/#107 #113

Merged
merged 9 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
66 changes: 66 additions & 0 deletions app/(sub-page)/tutorial/data.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import feature1 from '@/public/assets/tutorial/tutorial-feature1.png';
import feature2 from '@/public/assets/tutorial/tutorial-feature2.png';
import feature3 from '@/public/assets/tutorial/tutorial-feature3.png';
import upload0 from '@/public/assets/tutorial/tutorial0.png';
import upload1 from '@/public/assets/tutorial/tutorial1.png';
import upload2 from '@/public/assets/tutorial/tutorial2.png';
import upload3 from '@/public/assets/tutorial/tutorial3.png';
import upload4 from '@/public/assets/tutorial/tutorial4.png';
import { StaticImageData } from 'next/image';
Copy link
Member

Choose a reason for hiding this comment

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

importํ•œ ์ด๋ฆ„์ด upload์ธ ์ด์œ ๊ฐ€ ์žˆ๋‚˜์š”?

Copy link
Member Author

Choose a reason for hiding this comment

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

upload file image๋ผ์„œ upload๋ผ๊ณ  ์ž‘์„ฑํ–ˆ๋Š”๋ฐ, ์„ค๋ช…์ด ๋ถ€์กฑํ•œ ๊ฒƒ ๊ฐ™๋„ค์š” ์ˆ˜์ •์ง„ํ–‰ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค !

import Link from 'next/link';

interface TutorialItem {
imageUrl: StaticImageData;
title: string;
content: React.ReactNode;
}

export const TUTORIAL_FEATRUE: TutorialItem[] = [
{
imageUrl: feature1,
title: 'first',
content: '๊ฐ•์˜ ์ปค์Šคํ…€์„ ํ†ตํ•œ ์กธ์—… ์‚ฌ์ • ์˜ˆ์ธก',
},
{
imageUrl: feature2,
title: 'second',
content: '์นดํ…Œ๊ณ ๋ฆฌ๋ณ„(๊ต์–‘ / ์ „๊ณต) ์ˆ˜๊ฐ• ํ•™์  ํ˜„ํ™ฉ ์กฐํšŒ',
},
{
imageUrl: feature3,
title: 'third',
content: '์นดํ…Œ๊ณ ๋ฆฌ๋ณ„(๊ต์–‘ / ์ „๊ณต) ๋ฏธ์ด์ˆ˜ ๊ณผ๋ชฉ ์ •๋ณด ๋ฐ ์ž”์—ฌ ํ•™์  ์กฐํšŒ',
},
];

export const TUTORIAL_UPLOAD: TutorialItem[] = [
{
imageUrl: upload0,
title: '1.',
content: (
<Link href="https://msi.mju.ac.kr/servlet/security/MySecurityStart" target="_blank">
<span className="text-primary">MyiWeb MSI</span>์— ์ ‘์† ํ›„ ๋กœ๊ทธ์ธ(PCํ™˜๊ฒฝ ๊ถŒ์žฅ)
</Link>
),
},
{
imageUrl: upload1,
title: '2.',
content: '์ขŒ์ธก ์„ฑ์ /์กธ์—… ๋ฉ”๋‰ด โ†’ ์„ฑ์ ํ‘œ(์ƒ๋‹ด์šฉ,B4)ํด๋ฆญ',
},
{
imageUrl: upload2,
title: '3.',
content: '์šฐ์ธก ์ƒ๋‹จ ์กฐํšŒ๋ฒ„ํŠผ ํด๋ฆญ โ†’ ํ”„๋ฆฐํŠธ ์•„์ด์ฝ˜ ํด๋ฆญ (๋ชจ๋ฐ”์ผ ํ™˜๊ฒฝ์—์„œ๋Š” ๋œจ์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.)',
},
{
imageUrl: upload3,
title: '4.',
content: '์ธ์‡„ ์ •๋ณด์˜ ๋Œ€์ƒ(PDF๋กœ ์ €์žฅ) ์„ค์ • โ†’ ํ•˜๋‹จ ์ €์žฅ ๋ฒ„ํŠผ ํด๋ฆญ (๋น„์œจ์ด ๊นจ์ง€์ง€ ์•Š๋„๋ก ์กฐ์‹ฌํ•ด์ฃผ์„ธ์š”.)',
},
{
imageUrl: upload4,
title: '5.',
content: '์ €์žฅํ•œ ํŒŒ์ผ ์—…๋กœ๋“œ',
},
];
44 changes: 44 additions & 0 deletions app/(sub-page)/tutorial/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import ImageCard from '@/app/ui/view/molecule/image-card/image-card';
import TitleBox from '@/app/ui/view/molecule/title-box/title-box';
import { cn } from '@/app/utils/shadcn/utils';
import Image from 'next/image';
import { TUTORIAL_FEATRUE, TUTORIAL_UPLOAD } from './data';
import ContentContainer from '@/app/ui/view/atom/content-container/content-container';

function TutorialPage() {
return (
<ContentContainer className={cn('flex flex-col gap-10 p-1 py-10', 'md:gap-20')} size="lg">
<h1 className={cn('text-center text-xl font-bold', 'md:text-3xl')}>ํŠœํ† ๋ฆฌ์–ผ</h1>
<p className={cn('w-[90%] m-auto break-keep text-center text-base text-gray-6 font-semibold', 'md:text-2xl')}>
๋ช…์ง€์ธ์„ ์œ„ํ•œ ์กธ์—… ์š”๊ฑด ์ถฉ์กฑ๋„ ํ™•์ธ ์„œ๋น„์Šค โ€˜์กธ์—…์„๋ถ€ํƒํ•ดโ€™ ์ž…๋‹ˆ๋‹ค. <br />
์šฐ๋ฆฌ ์„œ๋น„์Šค์˜ ์ฃผ์š” ์ •๋ณด์™€ ์‚ฌ์šฉ๋ฒ•์„ ํ™•์ธํ•ด๋ณด์„ธ์š”
</p>
<TitleBox title="์ฃผ์š” ๊ธฐ๋Šฅ">
<div className="flex gap-2 p-2">
{TUTORIAL_FEATRUE.map((feature, index) => (
<Image src={feature.imageUrl} alt={`feature-${index}`} key={index} className="max-w-[32%]" />
))}
</div>
</TitleBox>
<p className={cn('w-[90%] m-auto break-keep text-center text-base text-gray-6 font-semibold', 'md:text-2xl')}>
์ •๋ณด ์ œ๊ณต์„ ์œ„ํ•ด์„œ๋Š” ์—ฌ๋Ÿฌ๋ถ„์˜ ์ด์ˆ˜๊ณผ๋ชฉ ์ •๋ณด๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
<br /> PDF ์—…๋กœ๋“œ๋ฅผ ์ง„ํ–‰ํ•ด์ฃผ์„ธ์š”.
</p>
<TitleBox title="PDF ํŒŒ์ผ ์—…๋กœ๋“œ ๋ฐฉ๋ฒ•">
<div className="flex overflow-scroll gap-8 w-full mt-4">
{TUTORIAL_UPLOAD.map((feature, index) => (
<ImageCard
key={index}
image={feature.imageUrl}
title={feature.title}
content={feature.content}
className="min-w-44 h-44 md:min-w-72 md:h-72"
/>
))}
</div>
</TitleBox>
</ContentContainer>
);
}

export default TutorialPage;
1 change: 1 addition & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ a {

::-webkit-scrollbar {
width: 10px;
height: 10px;
}

::-webkit-scrollbar-track {
Expand Down
6 changes: 5 additions & 1 deletion app/hooks/useDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ export default function useDialog(key: DialogKey, onClose?: () => void) {
setOpenDialogList([key, true]);
};

const close = () => {
setOpenDialogList([key, false]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

onclose callback ํ˜ธ์ถœ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค

};

const toggle = () => {
const prevState = isOpenDialogList[key];
setOpenDialogList([key, !prevState]);

if (prevState) onClose?.();
};

return { isOpen, open, toggle };
return { isOpen, open, toggle, close };
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import LabelContainerSkeleton from '@/app/ui/view/atom/label-container/label-container.skeleton';
import Skeleton from '@/app/ui/view/atom/skeleton';
import Skeleton from '@/app/utils/skeleton';

export default function ResultCategoryDetailContentSkeleton() {
return (
Expand Down
20 changes: 20 additions & 0 deletions app/ui/view/molecule/image-card/image-card.stories.tsx
Copy link
Member

Choose a reason for hiding this comment

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

์ œ๊ฐ€ ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ ์Šคํ† ๋ฆฌ๋ถ ๋ฌธ์„œํ™”๋ฅผ ์ง„ํ–‰ํ–ˆ๋Š”๋ฐ, ์ฐธ๊ณ ํ•ด์„œ ์กฐ๊ธˆ ๋” ์ž‘์„ฑํ•ด์ฃผ์‹ค ์ˆ˜ ์žˆ๋‚˜์š”??

Copy link
Member Author

Choose a reason for hiding this comment

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

PR์—๋„ ์ž‘์„ฑํ–ˆ๋Š”๋ฐ, ์Šคํ† ๋ฆฌ๋ถ ๋ฌธ์„œํ™”๋Š” ๋‹ค๋ฅธ ํŒŒ์ผ๋“ค ๋ณ€๊ฒฝ๊ณผ ๊ฐ™์€ PR๋กœ ๋ฌถ์–ด์„œ ์ง„ํ–‰ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import feature1 from '@/public/assets/tutorial/tutorial-feature1.png';
import type { Meta, StoryObj } from '@storybook/react';
import ImageCard, { ImageCardProps } from './image-card';

const meta = {
title: 'ui/view/molecule/ImageCard',
component: ImageCard,
} as Meta<typeof ImageCard>;

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

export const Default: Story = {
args: {
image: feature1,
title: 'first',
content: '๊ฐ•์˜ ์ปค์Šคํ…€์„ ํ†ตํ•œ ์กธ์—… ์‚ฌ์ • ์˜ˆ์ธก',
},
render: (args: ImageCardProps) => <ImageCard {...args} />,
};
21 changes: 21 additions & 0 deletions app/ui/view/molecule/image-card/image-card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { cn } from '@/app/utils/shadcn/utils';
import Image, { StaticImageData } from 'next/image';

export interface ImageCardProps {
image: StaticImageData;
title: string;
content: React.ReactNode;
className?: string;
}

function ImageCard({ image, title, content, className }: ImageCardProps) {
return (
<div className={cn('flex flex-col gap-2', 'md:gap-4')}>
<Image src={image} alt={title} className={className} />
<h5 className={cn('font-lg font-medium', 'md:text-2xl')}>{title}</h5>
<p className={cn('text-xs', 'md:text-base')}>{content}</p>
</div>
);
}

export default ImageCard;
23 changes: 23 additions & 0 deletions app/ui/view/molecule/title-box/title-box.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { Meta, StoryObj } from '@storybook/react';
import TitleBox from './title-box';
import AnnounceMessageBox from '../announce-message-box/announce-massage-box';

const meta = {
title: 'ui/view/molecule/TitleBox',
component: TitleBox,
} as Meta<typeof TitleBox>;

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

interface TitleBoxProps extends React.PropsWithChildren {
title: string;
}

export const Default: Story = {
args: {
children: <AnnounceMessageBox message="ํ•ด๋‹น ํŒŒํŠธ์˜ ์กธ์—…์š”๊ฑด์„ ์ถฉ์กฑํ•˜์…จ์Šต๋‹ˆ๋‹ค!" />,
title: '์กธ์—… ์š”๊ฑด ์•ˆ๋‚ด',
},
render: (args: TitleBoxProps) => <TitleBox {...args} />,
};
13 changes: 13 additions & 0 deletions app/ui/view/molecule/title-box/title-box.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { cn } from '@/app/utils/shadcn/utils';

function TitleBox({ title, children }: React.PropsWithChildren<{ title: string }>) {
return (
<div className="flex flex-col justify-center items-center gap-4">
<h1 className={cn('text-lg font-bold', 'md:text-2xl')}>{title}</h1>
<div className="bg-primary h-1 w-10 text-center rounded-md"></div>
{children}
</div>
);
}

export default TitleBox;
Binary file added public/assets/tutorial/tutorial-feature1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/tutorial/tutorial-feature2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/tutorial/tutorial-feature3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/tutorial/tutorial0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/tutorial/tutorial1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/tutorial/tutorial2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/tutorial/tutorial3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/tutorial/tutorial4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading