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
Add Scoped Notification Component #1785
Add Scoped Notification Component #1785
Conversation
Props approved.
|
@interactivellama I have made the necessary changes making the Icon prop optional, and setting info icon as default. |
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.
This good is almost done. There are a few small changes to make and I should be able to merge.
`slds-scoped-notification`, | ||
`slds-media`, | ||
`slds-media_center`, | ||
`slds-scoped-notification_${this.props.theme}`, |
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.
CSS class names should not be concatenated. Please list out object keys with boolean values https://github.com/salesforce/design-system-react/blob/master/docs/codebase-overview.md#use-classnames-for-conditional-css-classes
render() { | ||
return ( | ||
<div | ||
style={{ |
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.
Please remove extra styling.
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.
I have removed extra styling from both light and dark examples
// Implements the [Scoped Notification design pattern](https://lightningdesignsystem.com/components/scoped-notifications/) in React. | ||
// Based on SLDS v2.4.5 | ||
import IconSettings from '~/components/icon-settings'; | ||
import Icon from '~/components/icon'; |
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.
The ~ import prefix should only be used in examples and not in components. I'm not sure what is documented anyway though. It's in the examples because a regular expression transform is run on them in the doc website.
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.
I have replaced those with
import IconSettings from '../icon-settings';
import Icon from '../icon';
/** | ||
* Icon for the scoped notification | ||
*/ | ||
icon: PropTypes.string, |
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.
Icon would the an <Icon>
component. This should probably be iconName
and folks should know that it's limited to the utility set of icons at this point. https://www.lightningdesignsystem.com/icons/#utility
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.
Ya, True. I went for a rather generic name, thanks for patching it up. I will take a note of it, and would update for the other prop proposals I have made elsewhere as well.
This pull request does not have any tests. Since the component is not interactive Jest snapshots would be enough. |
…to pr/aswinshenoy/1785 # Conflicts: # utilities/constants.js
role="status" | ||
> | ||
<div className="slds-media__figure"> | ||
<IconSettings iconPath="/assets/icons"> |
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.
This line would limit all uses of the component to use this path. This should be removed. IconSettings
should only be used outside a component by the consumer to allow customization.
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.
Oh true. I didn't think about it, thank you for fixing it :)
> | ||
<div className="slds-media__figure"> | ||
<IconSettings iconPath="/assets/icons"> | ||
<Icon |
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.
This icon isn't using slds-icon-text-default
classname which would make it darker. It's light here in Storybook, but dark on the SLDS website https://www.lightningdesignsystem.com/components/scoped-notifications/
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.
Sorry again, I missed out that. Thank you for fixing it, and in the case in future, if you are engaged, I would be more than happy to patch these reviews comments :)
update icon to iconName since it is not an Icon component
…ystem-react into pr/aswinshenoy/1785 # Conflicts: # components/scoped-notification/__examples__/dark.jsx # components/scoped-notification/__examples__/light.jsx # components/scoped-notification/index.jsx
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.
Those CI output lines look correct. What issues are you seeing? |
Fixes #1738
Add Scoped Notification Component
@interactivellama @futuremint, kindly review it, I will make any changes required.
Additional description
The Scoped Navigation component as found in SLDS has been ported to react, with almost all its functionality, and reusing the same classes.
Props Taken
className
- CSS classes to be added to tag with .slds-scoped-notification.iconName
- Icon for the Scoped Notificationtheme
- Either Dark or LightScreenshots
Light Variant
Dark Variant
CONTRIBUTOR checklist (do not remove)
Please complete for every pull request
npm run lint:fix
has been run and linting passes.components/component-docs.json
CI tests pass (npm test
).REVIEWER checklist (do not remove)
components/component-docs.json
tests.Required only if there are markup / UX changes
last-slds-markup-review
inpackage.json
and push.last-accessibility-review
, topackage.json
and push.npm run local-update
within locally cloned site repo to confirm the site will function correctly at the next release.