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

change ItemType enum to avoid breaking change #234

Merged
merged 1 commit into from
Nov 30, 2020
Merged
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
8 changes: 3 additions & 5 deletions src/components/table-of-contents/TableOfContentsItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ import { Link } from '../Link';

type SetMenuOpenStateById = (args: { id: string; isOpen: boolean }) => void;

// export type ItemType = 'menu' | 'link' | 'bullet-link';

export enum ItemType {
MENU,
LINK,
BULLET_LINK,
MENU = 'menu',
LINK = 'link',
BULLET_LINK = 'bullet-link',
Comment on lines -15 to +18
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't totally follow this, just because I'm not familiar w/ enums in TS. Was this previously exporting each of these as, for example, the uppercased MENU vs menu?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As numbers. MENU = 0, LINK = 1, etc. That's the default behaviour for TS enums

}

export interface Item {
Expand Down