/*
Copyright (C) 2017 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
import React, { CSSProperties } from "react";
import { Link } from "react-router";
import { observer } from "mobx-react";
import styled from "styled-components";
import autobind from "autobind-decorator";
import Logo from "@src/components/ui/Logo";
import userStore from "@src/stores/UserStore";
import configLoader from "@src/utils/Config";
import { navigationMenu } from "@src/constants";
import { ThemeProps } from "@src/components/Theme";
import backgroundImage from "@src/components/ui/Images/star-bg.jpg";
import cbsImage from "./images/cbsl-logo.svg";
import cbsImageSmall from "./images/cbsl-logo-small.svg";
import tinyLogo from "./images/logo-small.svg";
import transferImage from "./images/transfer-menu.svg";
import endpointImage from "./images/endpoint-menu.svg";
import planningImage from "./images/planning-menu.svg";
import projectImage from "./images/project-menu.svg";
import userImage from "./images/user-menu.svg";
import logsImage from "./images/logs-menu.svg";
import dashboardImage from "./images/dashboard-menu.svg";
import minionPoolsImage from "./images/minion-pool-menu.svg";
import bareMetalServersImage from "./images/bare-metal-servers.svg";
const isCollapsed = (props: any) =>
props.collapsed || window.outerWidth <= ThemeProps.mobileMaxWidth;
const ANIMATION = "200ms";
const Wrapper = styled.div`
background-image: url("${backgroundImage}");
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
width: ${props => (isCollapsed(props) ? "80px" : "320px")};
transition: width ${ANIMATION};
`;
const LogoWrapper = styled.div`
position: relative;
height: 48px;
margin-top: 48px;
width: 100%;
display: flex;
justify-content: center;
`;
const LogoStyled = styled(Logo)`
position: absolute;
top: 0;
left: ${props => (isCollapsed(props) ? "-9999px" : "auto")};
cursor: pointer;
display: flex;
`;
const WrappedLink = (props: any) => (
{
if (props.customRef) props.customRef(r);
}}
>
{props.children}