<commit_before>import { Components, registerComponent, withCurrentUser, withList, withEdit } from 'meteor/vulcan:core';
import Users from "meteor/vulcan:users";
import React, { Component } from 'react';

import Popover from 'material-ui/Popover';
import {List, ListItem} from 'material-ui/List';
import PropTypes from 'prop-types';
import Drawer from 'material-ui/Drawer';
import Badge from 'material-ui/Badge';
import {Tabs, Tab} from 'material-ui/Tabs';
import AllIcon from 'material-ui/svg-icons/social/notifications';
import UnreadIcon from 'material-ui/svg-icons/action/visibility-off';
import PostsIcon from 'material-ui/svg-icons/action/description';
import CommentsIcon from 'material-ui/svg-icons/editor/mode-comment';
import MessagesIcon from 'material-ui/svg-icons/communication/forum';

// import { NavDropdown, MenuItem } from 'react-bootstrap';
import { Link } from 'react-router';
import Notifications from '../../lib/collections/notifications/collection.js'


const badgeContainerStyle = {
  padding: 'none',
}
const badgeStyle = {
  backgroundColor: 'none',
  color: 'rgba(0,0,0,0.6)',
  fontFamily: 'freight-sans-pro, sans-serif',
  right: "-16px"
}

const tabLabelStyle = {
  color: "rgba(0,0,0,0.8)",
  fontFamily: "freight-sans-pro, sans-serif"
}

const iconStyle = {
  color: "rgba(0,0,0,0.8)",
}

class NotificationsMenu extends Component {
  constructor(props, context) {
    super(props);
    this.state = {
      notificationTerms: {view: 'userNotifications', userId: props.currentUser._id},
      lastNotificationsCheck: props.currentUser.lastNotificationsCheck
    }
  }
  render() {
      const newMessages = this.props.results && _.filter(this.props.results, (x) => x.createdAt > this.state.lastNotificationsCheck);
      const currentUser = this.props.currentUser;
      if (!currentUser) {
        return null;
      } else {
        const AllNotificationTerms = {view: 'userNotifications', userId: currentUser._id};
        const PostsNotificationTerms = {view: 'userNotifications', userId: currentUser._id, type: "newPost"};
        const CommentsNotificationTerms = {view: 'userNotifications', userId: currentUser._id, type: "newComment"};
        const MessagesNotificationTerms = {view: 'userNotifications', userId: currentUser._id, type: "newMessage"};
        return (
          <div className="notifications-menu">
            <Drawer
              open={this.props.open}
              width={300}
              containerStyle={{top: "64px", zIndex: "1000", height: "100vh", boxShadow: "none", transition: "transform 200ms cubic-bezier(0.23, 1, 0.32, 1) 0ms", borderLeft: "1px solid rgba(0,0,0,0.05)"}}
              containerClassName="notifications-menu-container"
              openSecondary={true}<commit_msg>Fixed things for logged out users<commit_after>import { Components, registerComponent, withCurrentUser, withList, withEdit } from 'meteor/vulcan:core';
import Users from "meteor/vulcan:users";
import React, { Component } from 'react';

import Popover from 'material-ui/Popover';
import {List, ListItem} from 'material-ui/List';
import PropTypes from 'prop-types';
import Drawer from 'material-ui/Drawer';
import Badge from 'material-ui/Badge';
import {Tabs, Tab} from 'material-ui/Tabs';
import AllIcon from 'material-ui/svg-icons/social/notifications';
import UnreadIcon from 'material-ui/svg-icons/action/visibility-off';
import PostsIcon from 'material-ui/svg-icons/action/description';
import CommentsIcon from 'material-ui/svg-icons/editor/mode-comment';
import MessagesIcon from 'material-ui/svg-icons/communication/forum';

// import { NavDropdown, MenuItem } from 'react-bootstrap';
import { Link } from 'react-router';
import Notifications from '../../lib/collections/notifications/collection.js'


const badgeContainerStyle = {
  padding: 'none',
}
const badgeStyle = {
  backgroundColor: 'none',
  color: 'rgba(0,0,0,0.6)',
  fontFamily: 'freight-sans-pro, sans-serif',
  right: "-16px"
}

const tabLabelStyle = {
  color: "rgba(0,0,0,0.8)",
  fontFamily: "freight-sans-pro, sans-serif"
}

const iconStyle = {
  color: "rgba(0,0,0,0.8)",
}

class NotificationsMenu extends Component {
  constructor(props, context) {
    super(props);
    this.state = {
      notificationTerms: {view: 'userNotifications', userId: props.currentUser ? props.currentUser._id : ""},
      lastNotificationsCheck: props.currentUser.lastNotificationsCheck
    }
  }
  render() {
      const newMessages = this.props.results && _.filter(this.props.results, (x) => x.createdAt > this.state.lastNotificationsCheck);
      const currentUser = this.props.currentUser;
      if (!currentUser) {
        return null;
      } else {
        const AllNotificationTerms = {view: 'userNotifications', userId: currentUser._id};
        const PostsNotificationTerms = {view: 'userNotifications', userId: currentUser._id, type: "newPost"};
        const CommentsNotificationTerms = {view: 'userNotifications', userId: currentUser._id, type: "newComment"};
        const MessagesNotificationTerms = {view: 'userNotifications', userId: currentUser._id, type: "newMessage"};
        return (
          <div className="notifications-menu">
            <Drawer
              open={this.props.open}
              width={300}
              containerStyle={{top: "64px", zIndex: "1000", height: "100vh", boxShadow: "none", transition: "transform 200ms cubic-bezier(0.23, 1, 0.32, 1) 0ms", borderLeft: "1px solid rgba(0,0,0,0.05)"}}
              containerClassName="notifications-menu-container"
              openSecondary={true}
{'fraction_non_alphanumeric': 0.1367321203386777, 'fraction_numerical': 0.017294181228607458, 'mean_word_length': 4.08890925756187, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3750412', 'n_tokens_mistral': 1751, 'n_tokens_neox': 1687, 'n_words': 387}