import React from 'react'; import PropTypes from 'prop-types'; import { UncontrolledTooltip } from 'reactstrap'; import { withTranslation } from 'react-i18next'; import { withUnstatedContainers } from './UnstatedUtils'; import { toastError } from '../util/apiNotification'; import PageContainer from '../services/PageContainer'; import AppContainer from '../services/AppContainer'; import NavigationContainer from '../services/NavigationContainer'; class BookmarkButton extends React.Component { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); } async handleClick() { const { pageContainer } = this.props; const isGuestUser = pageContainer.state.isGuestUser; if (isGuestUser) { return; } try { pageContainer.toggleBookmark(); } catch (err) { toastError(err); } } render() { const { appContainer, pageContainer, navigationContainer, t, } = this.props; const { isGuestUser } = appContainer; const { editorMode } = navigationContainer.state; const isViewMode = editorMode === 'view'; return (