Skip to content

Commit

Permalink
[notification-refactor] make empty view into a component
Browse files Browse the repository at this point in the history
  • Loading branch information
Le Zheng committed Aug 9, 2017
1 parent 5ab7bfc commit 9f22eec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
11 changes: 11 additions & 0 deletions src/containers/Header/NotificationsTray/EmptyView/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styles from '../style.postcss';
import React from 'react';

const EmptyView = () => <div className={styles.NotificationsTray_popup_empty}>
<h1>Hello!</h1>
<p>You don't have any notifications yet.</p>
<aside>New notifications will appear here when <br />
teachers add internal notes for your students.</aside>
</div>;

export default EmptyView;
9 changes: 2 additions & 7 deletions src/containers/Header/NotificationsTray/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Icon from 'components/Icon';
import Callout from 'components/Callout';
import Button from 'components/Button';
import Checkbox from 'components/Checkbox';
import EmptyView from './EmptyView';

class NotificationsTray extends PureComponent {
constructor() {
Expand Down Expand Up @@ -188,13 +189,7 @@ class NotificationsTray extends PureComponent {
Mark as read
</a> : null}
</div>
{! notifications || ! notifications.size ?
<div className={styles.NotificationsTray_popup_empty}>
<h1>Hello!</h1>
<p>You don't have any notifications yet.</p>
<aside>New notifications will appear here when <br />
teachers add internal notes for your students.</aside>
</div> : null}
{! notifications || ! notifications.size ? <EmptyView /> : null}
{this._renderNotifications(notifications)}
{this._renderNotificationFooter(notifications)}
</div>
Expand Down

0 comments on commit 9f22eec

Please sign in to comment.