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

fix(toast-notification): remove default value from optional caption prop #7901

Conversation

janhassel
Copy link
Member

According to the toast notification's component guidelines and the propTypes, the caption prop (intended for timestamp) is optional. However, currently it defaults to "provide a caption" which
a) makes it seem to be required (as other component usually do this for missing, required props such as titles), and
b) require the developer to pass an empty caption to the component in order to remove it, which is unusual for an optional prop

Changelog

Removed

  • removed default value ("provide a caption") for props.caption in ToastNotification

Testing / Reviewing

  • If no caption is passed, there should be no rendered caption
  • If a caption is passed, it should be rendered

@netlify
Copy link

netlify bot commented Feb 25, 2021

Deploy preview for carbon-elements ready!

Built with commit 7b85334

https://deploy-preview-7901--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Feb 25, 2021

Deploy preview for carbon-components-react ready!

Built without sensitive environment variables with commit 7b85334

https://deploy-preview-7901--carbon-components-react.netlify.app

@tw15egan
Copy link
Member

Everything looks good code-wise, just want to get some design input if the padding is correct when there is no caption

Screen Shot 2021-02-25 at 9 56 13 AM

Copy link
Member

@kingtraceyj kingtraceyj left a comment

Choose a reason for hiding this comment

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

the padding from the bottom is looking a little large. it should be 16px.
current:
image

updated:
image

@janhassel
Copy link
Member Author

@kingtraceyj updated 👍

Copy link
Member

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

LGTM 👍 ✅

Base automatically changed from master to main March 8, 2021 16:35
Copy link
Member

@kingtraceyj kingtraceyj left a comment

Choose a reason for hiding this comment

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

looks good to me. thanks for the update!

@kodiakhq kodiakhq bot merged commit 279ce00 into carbon-design-system:main Mar 11, 2021
@janhassel janhassel deleted the toast-notification-optional-caption branch March 11, 2021 19:54
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.

None yet

6 participants