-
Notifications
You must be signed in to change notification settings - Fork 142
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
refactor(EmptyState): add types to EmptyState #5711
refactor(EmptyState): add types to EmptyState #5711
Conversation
✅ Deploy Preview for carbon-for-ibm-products ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
95b7563
* Empty state link object | ||
*/ | ||
link?: { | ||
text?: string | ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text?: string | ReactNode; | |
text?: ReactNode; |
ReactNode
includes string no need to specify again
/** | ||
* Empty state subtitle | ||
*/ | ||
subtitle?: string | ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subtitle?: string | ReactNode; | |
subtitle?: ReactNode; |
/** | ||
* Empty state title | ||
*/ | ||
title: string | ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: string | ReactNode; | |
title: ReactNode; |
@@ -68,7 +68,7 @@ interface EmptyStateV2Props { | |||
* Props for the link. Refer to the Carbon Components link documentation for full list of props. | |||
*/ | |||
link?: { | |||
text?: string; | |||
text?: string | ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text?: string | ReactNode; | |
text?: ReactNode; |
Closes #4262
Convert
EmptyState
to typescriptWe need to add the
ReactNode
type to thelink
prop inEmptyStateV2
as the same props fromEmptyState
are passed intoEmptyStateV2
and typescript complains that the prop types do not matchWhat did you change?
packages/ibm-products/src/components/EmptyStates/EmptyState.tsx
packages/ibm-products/src/components/EmptyStates/EmptyStateV2.tsx
How did you test and verify your work?
storybook