import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import ImmutablePropTypes from 'react-immutable-proptypes' import ImmutablePureComponent from 'react-immutable-pure-component' import { openPopover } from '../../actions/popover' import { changeSetting, saveSettings } from '../../actions/settings' import { resendUserConfirmationEmail } from '../../actions/user' import { openModal } from '../../actions/modal' import { BREAKPOINT_EXTRA_SMALL, MODAL_EMAIL_CONFIRMATION_REMINDER, } from '../../constants' import { me, meEmail, emailConfirmed, } from '../../initial_state' import { makeGetAccount } from '../../selectors' import Responsive from '../../features/ui/util/responsive_component' import { CX, THEMES, DEFAULT_THEME, POPOVER_NAV_SETTINGS, } from '../../constants' import Avatar from '../avatar' import BackButton from '../back_button' import Button from '../button' import Heading from '../heading' import Icon from '../icon' import NavigationBarButton from '../navigation_bar_button' import Search from '../search' import Text from '../text' import Divider from '../divider' class DeckSidebar extends ImmutablePureComponent { handleOnClickLightBulb = () => { let index = THEMES.findIndex((t) => t === this.props.theme) const nextIndex = (index === THEMES.length -1) ? 0 : index += 1 const newTheme = THEMES[nextIndex] this.props.onChange('theme', newTheme) } handleOnOpenNavSettingsPopover = () => { this.props.onOpenNavSettingsPopover(this.avatarNode) } handleOnClickResendConfirmationEmail = () => { const { emailConfirmationResends } = this.props if (emailConfirmationResends % 2 === 0 && emailConfirmationResends > 0) { this.props.onOpenEmailModal() } this.props.onResendUserConfirmationEmail() } setAvatarNode = (c) => { this.avatarNode = c } render() { const { title, showBackBtn, actions, tabs, account, noActions, logoDisabled, unreadChatsCount, notificationCount, } = this.props const navigationContainerClasses = CX({ d: 1, z4: 1, w76PX: 1, w100PC: 1, }) const innerNavigationContainerClasses = CX({ d: 1, w76PX: 1, bgNavigation: 1, aiCenter: 1, z3: 1, top0: 1, bottom0: 1, left0: 1, borderRight1PX: 1, borderColorSecondary: 1, posFixed: 1, }) const isHome = title === 'Home' return (