diff --git a/example/src/SiteWrapper.react.js b/example/src/SiteWrapper.react.js index 69e3039e..25d318b1 100644 --- a/example/src/SiteWrapper.react.js +++ b/example/src/SiteWrapper.react.js @@ -12,17 +12,14 @@ import { RouterContextProvider, } from "tabler-react"; +import type { NotificationProps } from "tabler-react"; + type Props = {| +children: React.Node, |}; type State = {| - notificationsObjects: Array<{ - unread: boolean, - avatarURL: string, - message: React.Node, - time: string, - }>, + notificationsObjects: Array, |}; type subNavItem = {| diff --git a/src/components/Notification/Notification.react.js b/src/components/Notification/Notification.react.js index 8b567cc1..79ba17f5 100644 --- a/src/components/Notification/Notification.react.js +++ b/src/components/Notification/Notification.react.js @@ -17,7 +17,7 @@ export type Props = {| */ +time?: string, /** - * The time displayed within the Notification + * Indicate the notification as unread */ +unread?: boolean, |}; @@ -25,7 +25,7 @@ export type Props = {| /** * An individual Notification made up of an Avatar alongside some text and the time */ -function Notification({ avatarURL, message, time }: Props): React.Node { +function Notification({ avatarURL, message, time, unread }: Props): React.Node { return ( {avatarURL && ( diff --git a/src/components/Notification/index.js b/src/components/Notification/index.js index f183dc47..426ac511 100644 --- a/src/components/Notification/index.js +++ b/src/components/Notification/index.js @@ -1,5 +1,7 @@ // @flow import Notification from "./Notification.react"; +import type Props from "./Notification.react"; export { Notification as default }; +export type { Props as NotificationProps }; diff --git a/src/components/index.js b/src/components/index.js index 25f7137e..d5ae564a 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,5 +1,8 @@ // @flow +import type NotificationProps from "./Notification"; +export type { NotificationProps }; + export { default as AccountDropdown } from "./AccountDropdown"; export { default as Alert } from "./Alert"; export { default as Avatar } from "./Avatar"; diff --git a/src/index.js b/src/index.js index e5a915a8..49f60eab 100644 --- a/src/index.js +++ b/src/index.js @@ -16,6 +16,7 @@ export type { Selection as SelectionEvents } from "./flow"; export type { Touch as TouchEvents } from "./flow"; export type { UserInterface as UIEvents } from "./flow"; export type { Wheel as WheelEvents } from "./flow"; +export type { NotificationProps } from "./components"; export { default as RouterContextProvider,