about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features/notifications/index.jsx
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-21 10:03:55 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-21 10:03:55 +0100
commite616ffc5d60acafb67dadf90e396226d408d0cda (patch)
tree1be2e4094a5b29663f599f379c1bf9d2808acb51 /app/assets/javascripts/components/features/notifications/index.jsx
parent29b12f9e0abb5031b368f2815d6408705e0498c6 (diff)
Fix responsive layout breakpoint, replace mentions column with notifications
Diffstat (limited to 'app/assets/javascripts/components/features/notifications/index.jsx')
-rw-r--r--app/assets/javascripts/components/features/notifications/index.jsx39
1 files changed, 26 insertions, 13 deletions
diff --git a/app/assets/javascripts/components/features/notifications/index.jsx b/app/assets/javascripts/components/features/notifications/index.jsx
index 9c8b07dea..00feeece7 100644
--- a/app/assets/javascripts/components/features/notifications/index.jsx
+++ b/app/assets/javascripts/components/features/notifications/index.jsx
@@ -22,7 +22,8 @@ const Notifications = React.createClass({
 
   propTypes: {
     notifications: ImmutablePropTypes.list.isRequired,
-    dispatch: React.PropTypes.func.isRequired
+    dispatch: React.PropTypes.func.isRequired,
+    trackScroll: React.PropTypes.bool
   },
 
   mixins: [PureRenderMixin],
@@ -41,19 +42,31 @@ const Notifications = React.createClass({
   },
 
   render () {
-    const { intl, notifications } = this.props;
-
-    return (
-      <Column icon='bell' heading={intl.formatMessage(messages.title)}>
-        <ScrollContainer scrollKey='notifications'>
-          <div className='scrollable' onScroll={this.handleScroll}>
-            <div>
-              {notifications.map(item => <NotificationContainer key={item.get('id')} notification={item} accountId={item.get('account')} />)}
-            </div>
-          </div>
-        </ScrollContainer>
-      </Column>
+    const { intl, notifications, trackScroll } = this.props;
+
+    const scrollableArea = (
+      <div className='scrollable' onScroll={this.handleScroll}>
+        <div>
+          {notifications.map(item => <NotificationContainer key={item.get('id')} notification={item} accountId={item.get('account')} />)}
+        </div>
+      </div>
     );
+
+    if (trackScroll) {
+      return (
+        <Column icon='bell' heading={intl.formatMessage(messages.title)}>
+          <ScrollContainer scrollKey='notifications'>
+            {scrollableArea}
+          </ScrollContainer>
+        </Column>
+      );
+    } else {
+      return (
+        <Column icon='bell' heading={intl.formatMessage(messages.title)}>
+          {scrollableArea}
+        </Column>
+      );
+    }
   }
 
 });