Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

feat(NotificationTray): Style the unread notifications #378

Conversation

mattsoftware
Copy link
Contributor

Adds some background styling when showing unread notifications in the notifications tray

See #376 for conversation around this pull request.

Copy link
Contributor

@AaronCoplan AaronCoplan left a 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.

@@ -17,7 +17,12 @@ type Props = {|
|};

type State = {|
unreadCount: number,
notificationsObjects: Array<{
Copy link
Contributor

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>,

Copy link
Contributor Author

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?

Copy link
Contributor

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
Copy link
Contributor

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.

@mattsoftware
Copy link
Contributor Author

@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 :)

@AaronCoplan
Copy link
Contributor

@mattsoftware Looks good! The export works for me - tested by adding an additional prop that does not match the type in example/src/SiteWrapper.react.js and it gives a flow error. Thanks! 👍

@AaronCoplan AaronCoplan merged commit bcdd4e4 into tabler:master Dec 3, 2018
@jonthomp
Copy link
Contributor

jonthomp commented Dec 3, 2018

🎉 This PR is included in version 1.26.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants