import React, { Component } from "react"; import PropTypes from "prop-types"; import { connect } from "react-redux"; import { Navbar, Nav, NavItem } from "react-bootstrap"; import { FormattedMessage } from "react-intl"; import styled from "styled-components"; import { MAIN_COLOR_BLUE, WHITE_COLOR, BORDER_GRAY_COLOR } from "../../app/constants/colors"; import { getActivities, destroyActivities } from "../actions/ActivitiesActions"; import TeamSwitch from "./components/TeamSwitch"; import GlobalActivitiesModal from "./components/GlobalActivitiesModal"; import SearchDropdown from "./components/SearchDropdown"; import NotificationsDropdown from "./components/NotificationsDropdown"; import InfoDropdown from "./components/InfoDropdown"; import UserAccountDropdown from "./components/UserAccountDropdown"; const StyledNavbar = styled(Navbar)` background-color: ${WHITE_COLOR}; border-color: ${BORDER_GRAY_COLOR}; `; const StyledBrand = styled.a` background-color: ${MAIN_COLOR_BLUE}; &:hover, &:active, &:focus { background-color: ${MAIN_COLOR_BLUE} !important; } & > img { margin-top: -4px; max-width: 132px; max-height: 26px; } `; class Navigation extends Component { constructor(props) { super(props); this.state = { showActivitesModal: false, page: "", current_team: { id: 0 } }; this.selectItemCallback = this.selectItemCallback.bind(this); this.closeModalCallback = this.closeModalCallback.bind(this); } selectItemCallback(key, ev) { switch (key) { case 1: window.location = "/"; break; case 2: window.location = "/protocols"; break; case 3: window.location = `/teams/${this.props.current_team.id}/repositories`; break; case 4: ev.preventDefault(); this.setState({ showActivitesModal: !this.state.showActivitesModal }); // Call action creator to fetch activities from the server this.props.fetchActivities(); break; default: } } closeModalCallback() { this.setState({ showActivitesModal: false }); this.props.destroyActivities(); } render() { return (
Logo