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

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(NotificationTray): Fix a copy/paste comment issue and type import
  • Loading branch information
mattsoftware committed Dec 3, 2018
commit 96d9d18a9455cfe8d27de68b0a1c7733d41b717c
9 changes: 3 additions & 6 deletions example/src/SiteWrapper.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<NotificationProps>,
|};

type subNavItem = {|
Expand Down
4 changes: 2 additions & 2 deletions src/components/Notification/Notification.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ export type Props = {|
*/
+time?: string,
/**
* The time displayed within the Notification
* Indicate the notification as unread
*/
+unread?: boolean,
|};

/**
* 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 (
<React.Fragment>
{avatarURL && (
Expand Down
2 changes: 2 additions & 0 deletions src/components/Notification/index.js
Original file line number Diff line number Diff line change
@@ -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 };
3 changes: 3 additions & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down