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

refactor(EmptyState): add types to EmptyState #5711

Merged

Conversation

annawen1
Copy link
Member

@annawen1 annawen1 commented Jul 22, 2024

Closes #4262

Convert EmptyState to typescript

We need to add the ReactNode type to the link prop in EmptyStateV2 as the same props from EmptyState are passed into EmptyStateV2 and typescript complains that the prop types do not match

What 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

Copy link

netlify bot commented Jul 22, 2024

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit b683bc6
🔍 Latest deploy log https://app.netlify.com/sites/carbon-for-ibm-products/deploys/66a9442f287be10008a6f1ec
😎 Deploy Preview https://deploy-preview-5711--carbon-for-ibm-products.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@annawen1 annawen1 marked this pull request as ready for review July 26, 2024 20:14
@annawen1 annawen1 requested a review from a team as a code owner July 26, 2024 20:14
@annawen1 annawen1 requested review from davidmenendez and anamikaanu96 and removed request for a team July 26, 2024 20:14
@davidmenendez
Copy link
Contributor

@annawen1 looks like we have a conflict because this morning the v2 typescript refactor was merged #5747 which was a separate issue. oops! haha

@davidmenendez davidmenendez added this pull request to the merge queue Jul 30, 2024
Merged via the queue into carbon-design-system:main with commit 95b7563 Jul 30, 2024
19 checks passed
* Empty state link object
*/
link?: {
text?: string | ReactNode;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
text?: string | ReactNode;
text?: ReactNode;

ReactNode includes string no need to specify again

/**
* Empty state subtitle
*/
subtitle?: string | ReactNode;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
subtitle?: string | ReactNode;
subtitle?: ReactNode;

/**
* Empty state title
*/
title: string | ReactNode;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
text?: string | ReactNode;
text?: ReactNode;

@annawen1 annawen1 deleted the chore/empty-state-typescript branch August 12, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Typescript types to EmptyState
4 participants