-
-
Notifications
You must be signed in to change notification settings - Fork 541
feat(NotificationTray): Style the unread notifications #378
feat(NotificationTray): Style the unread notifications #378
Conversation
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.
Couple small changes, but once you make those it'll be good to merge! If the type import isn't doable, no worries, just thought it might be worth looking into.
example/src/SiteWrapper.react.js
Outdated
@@ -17,7 +17,12 @@ type Props = {| | |||
|}; | |||
|
|||
type State = {| | |||
unreadCount: number, | |||
notificationsObjects: Array<{ |
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.
Notification.react
exports its props, so could we potentially import this instead of redefining the type here? Not 100% sure if this is doable but maybe something like:
import type { Props as NotificationProps } from ...
Then you can type this as notificationsObjects: Array<NotificationProps>,
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.
Its doable, I would need to
a) import the Notification file directly, or
b) export the type from index.js
(I already tried this but as nothing else had this pattern I thought I would type a similar object). Do you have a preference?
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.
Let's export the type from index.js similar to lines 4-18 in that file (exporting event types).
@@ -16,6 +16,10 @@ export type Props = {| | |||
* The time displayed within the Notification | |||
*/ | |||
+time?: string, | |||
/** | |||
* The time displayed within the Notification |
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.
Looks like an accidental typo, change to something about read/unread.
@AaronCoplan Back to you for review. I am not 100% confident I handled the type export/import the way you were thinking. If you could give it another quick lookover and provide some options that would be great.... And sorry for the copy/paste error... ooops :) |
@mattsoftware Looks good! The export works for me - tested by adding an additional prop that does not match the type in |
🎉 This PR is included in version 1.26.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds some background styling when showing unread notifications in the notifications tray
See #376 for conversation around this pull request.