Skip to content

Commit

Permalink
Merge pull request #9948 from abailly-akamai/M3-7518
Browse files Browse the repository at this point in the history
refactor: [M3-7509, M3-7518] TopMenu and TagsList v7 Stories
  • Loading branch information
abailly-akamai authored Dec 1, 2023
2 parents 910ed58 + bf677ea commit 6dd45ff
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 206 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tech Stories
---

TopMenu and TagsList Storybook v7 Stories ([#9948](https://github.com/linode/manager/pull/9948))
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs';
import { ColorPalette } from './ColorPalette';

<Meta title="Core Styles/Color Palette" component={ColorPalette} />
<Meta title="Design System/Color Palette" component={ColorPalette} />

# Color Palette

Expand Down
45 changes: 0 additions & 45 deletions packages/manager/src/components/ImageSelect/imageIcons.stories.mdx

This file was deleted.

19 changes: 0 additions & 19 deletions packages/manager/src/components/Tags/Tags.stories.mdx

This file was deleted.

19 changes: 19 additions & 0 deletions packages/manager/src/components/Tags/Tags.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react';

import { Tags } from './Tags';

import type { TagsProps } from './Tags';
import type { Meta, StoryObj } from '@storybook/react';

export const Default: StoryObj<TagsProps> = {
render: (args) => <Tags {...args} />,
};

const meta: Meta<TagsProps> = {
args: {
tags: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5'],
},
component: Tags,
title: 'Components/Tags/Tags List',
};
export default meta;
7 changes: 4 additions & 3 deletions packages/manager/src/components/Tags/Tags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ import { ShowMore } from 'src/components/ShowMore/ShowMore';
import { Tag } from 'src/components/Tag/Tag';

export interface TagsProps {
/**
* An array of tags to be displayed.
*/
tags: string[];
}

const Tags = (props: TagsProps) => {
export const Tags = (props: TagsProps) => {
const { tags } = props;

const renderTags = (tags: string[]) => {
Expand Down Expand Up @@ -40,5 +43,3 @@ const Tags = (props: TagsProps) => {
</>
);
};

export { Tags };
33 changes: 0 additions & 33 deletions packages/manager/src/components/TopMenu.stories.mdx

This file was deleted.

49 changes: 0 additions & 49 deletions packages/manager/src/components/UIIcons.stories.mdx

This file was deleted.

55 changes: 0 additions & 55 deletions packages/manager/src/features/TopMenu/NavigationIcons.stories.mdx

This file was deleted.

22 changes: 22 additions & 0 deletions packages/manager/src/features/TopMenu/TopMenu.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import * as React from 'react';

import { TopMenu } from './TopMenu';

import type { TopMenuProps } from './TopMenu';
import type { Meta, StoryObj } from '@storybook/react';

export const Default: StoryObj<TopMenuProps> = {
render: (args) => <TopMenu {...args} />,
};

const meta: Meta<TopMenuProps> = {
args: {
desktopMenuToggle: () => null,
isSideMenuOpen: false,
openSideMenu: () => null,
username: 'User 1',
},
component: TopMenu,
title: 'Features/Navigation/Top Menu',
};
export default meta;
6 changes: 5 additions & 1 deletion packages/manager/src/features/TopMenu/TopMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ import SearchBar from './SearchBar/SearchBar';
import { TopMenuIcon } from './TopMenuIcon';
import { UserMenu } from './UserMenu';

interface TopMenuProps {
export interface TopMenuProps {
desktopMenuToggle: () => void;
isSideMenuOpen: boolean;
openSideMenu: () => void;
username: string;
}

/**
* - Items presented in the top navigation are considered universally important and should be available regardless of any particular task.
* - The number of items should be limited. In the future, **Help & Support** could become a drop down with links to **Community**, **Guides**, and etc.
*/
export const TopMenu = React.memo((props: TopMenuProps) => {
const { desktopMenuToggle, isSideMenuOpen, openSideMenu, username } = props;

Expand Down

0 comments on commit 6dd45ff

Please sign in to comment.