Skip to content

Commit

Permalink
feat: NavItem 컴포넌트 스토리 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ghdtjgus76 committed Aug 12, 2024
1 parent 555f731 commit bc2b59f
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/ui/src/assets/folder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions packages/ui/src/assets/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions packages/ui/src/components/NavItem/NavItem.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import type { Meta, StoryObj } from "@storybook/react";

import folderImageUrl from "../../assets/folder.svg";
import homeImageUrl from "../../assets/home.svg";
import Navbar from ".";

const meta = {
title: "Client/Navbar",
component: Navbar,
tags: ["autodocs"],
parameters: {
componentSubtitle: "Navbar 컴포넌트",
},
argTypes: {
imageUrl: {
control: false,
},
},
} satisfies Meta<typeof Navbar>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
args: {
href: "studies",
imageUrl: homeImageUrl,
alt: "home-icon",
name: "개설된 스터디",
},
};

export const WithSubItems: Story = {
args: {
href: "studies",
imageUrl: homeImageUrl,
alt: "home-icon",
name: "개설된 스터디",
items: [
{
href: "basic-web-study",
imageUrl: folderImageUrl,
alt: "folder-icon",
name: "기초 웹 스터디",
},
{
href: "dev-beginner-study",
imageUrl: folderImageUrl,
alt: "folder-icon",
name: "개발 입문 스터디",
},
{
href: "basic-mobile-study",
imageUrl: folderImageUrl,
alt: "folder-icon",
name: "기초 모바일 스터디",
},
],
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Link from "next/link";
import { useSelectedLayoutSegments } from "next/navigation";
import { useState } from "react";

import arrowImageUrl from "../assets/arrow.svg";
import arrowImageUrl from "../../assets/arrow.svg";

/**
* @description 내비게이션 바에서 사용하는 내비게이션 아이템 컴포넌트입니다.
Expand All @@ -19,7 +19,7 @@ import arrowImageUrl from "../assets/arrow.svg";
* @param {Array<{href: string, imageUrl: string, alt: string, name: string}>} [items] - 서브 내비게이션 아이템 배열
* @returns {JSX.Element} 내비게이션 아이템 컴포넌트
*/
interface NavItemProps {
export interface NavItemProps {
href: string;
imageUrl: string;
alt: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default as NavItem } from "./NavItem";
export { default as NavItem } from ".";

0 comments on commit bc2b59f

Please sign in to comment.