<commit_before>import React, { Component } from 'react'
import { withRouter, Link } from 'react-router'
import { translate } from 'cozy-ui/react/I18n'

import Menu, { Item } from 'components/Menu'
import { MoreButton } from 'components/Button'

import {
  ShareButton,
  // SharedByMeButton,
  // SharedWithMeButton,
  ShareModal
  // SharingDetailsModal
} from 'sharing'

import classNames from 'classnames'

import styles from '../../../styles/toolbar'

class AlbumToolbar extends Component {
  state = {
    showShareModal: false,
    showSharingDetailsModal: false
  }

  showShareModal = () => {
    this.setState({ showShareModal: true })
  }

  closeShareModal = () => {
    this.setState({ showShareModal: false })
  }

  showSharingDetailsModal = () => {
    this.setState({ showSharingDetailsModal: true })
  }

  closeSharingDetailsModal = () => {
    this.setState({ showSharingDetailsModal: false })
  }

  render() {
    const {
      t,
      location,
      album,
      sharedWithMe,
      // sharedByMe,
      readOnly,
      disabled = false
    } = this.props
    const {
      downloadAlbum,
      deleteAlbum,
      // leaveAlbum,
      selectItems,
      onRename
    } = this.props
    return (
      <div className={styles['pho-toolbar']} role="toolbar">
        <div className={styles['u-hide--mob']}>
          <ShareButton
            disabled={disabled}
            label={t('Albums.share.cta')}
            onClick={this.showShareModal}
          />
          {/* !sharedByMe &&
            !sharedWithMe && (
              <ShareButton
                disabled={disabled}
                label={t('Albums.share.cta')}
                onClick={this.showShareModal}
              />
            )}
          {sharedByMe && (
            <SharedByMeButton
              disabled={disabled}
              label={t('Albums.share.sharedByMe')}
              onClick={this.showShareModal}
            />
          )}
          {sharedWithMe && (
            <SharedWithMeButton
              disabled={disabled}
              label={t('Albums.share.sharedWithMe')}
              onClick={this.showSharingDetailsModal}
            />
          ) */}
        </div>
        <Menu
          disabled={disabled}
          className={styles['pho-toolbar-menu']}
          button={<MoreButton>{t('Toolbar.more')}</MoreButton>}
        >
          {!sharedWithMe && (
            <Item>
              <a
                className={classNames(
                  styles['pho-action-share'],
                  styles['u-hide--desk']
                )}
                onClick={this.showShareModal}
              >
                {t('Albums.share.cta')}
              </a>
            </Item>
          )}
          <Item>
            <a
              className={classNames(styles['pho-action-download'])}
              onClick={downloadAlbum}
            >
              {t('Toolbar.menu.download_album')}
            </a>
          </Item>
          <Item>
            <a
              className={classNames(styles['pho-action-rename'])}
              onClick={onRename}
            >
              {t('Toolbar.menu.rename_album')}
            </a>
          </Item>
          {!readOnly && (
            <Item>
              <Link
                className={classNames(styles['pho-action-addphotos'])}
                to={`${location.pathname}/edit`}
              >
                {t('Toolbar.menu.add_photos')}
              </Link>
            </Item>
          )}
          <hr className={styles['u-hide--desk']} />
          <Item>
            <a
              className={classNames(
                styles['pho-action-select'],
                styles['u-hide--desk']
              )}
              onClick={selectItems}
            >
              {t('Toolbar.menu.select_items')}
            </a>
          </Item>
          <hr />
          {!sharedWithMe && (
            <Item>
              <a
                className={classNames(styles['pho-action-delete'])}
                onClick={deleteAlbum}
              >
                {t('Toolbar.menu.album_delete')}
              </a>
            </Item>
          )}
          {/* sharedWithMe && (
            <Item>
              <a
                className={classNames(styles['pho-action-delete'])}
                onClick={leaveAlbum}
              >
                {t('Toolbar.menu.album_quit')}
              </a>
            </Item>
          ) */}
        </Menu>
        {this.state.showShareModal && (
          <ShareModal
            document={album}
            documentType="Albums"
            sharingDesc={album.name}
            onClose={this.closeShareModal}
          />
        )}
        {/* this.state.showSharingDetailsModal && (
          <SharingDetailsModal
            document={album}
            documentType="Albums"
            sharingDesc={album.name}
            onClose={this.closeSharingDetailsModal}
          />
        ) */}
      </div>
    )
  }
}

export default withRouter(translate()(AlbumToolbar))<commit_msg>chore: Removed some dead sharing code<commit_after>import React, { Component } from 'react'
import { withRouter, Link } from 'react-router'
import { translate } from 'cozy-ui/react/I18n'

import Menu, { Item } from 'components/Menu'
import { MoreButton } from 'components/Button'

import { ShareButton, ShareModal } from 'sharing'

import classNames from 'classnames'

import styles from '../../../styles/toolbar'

class AlbumToolbar extends Component {
  state = {
    showShareModal: false
  }

  showShareModal = () => {
    this.setState({ showShareModal: true })
  }

  closeShareModal = () => {
    this.setState({ showShareModal: false })
  }

  render() {
    const {
      t,
      location,
      album,
      sharedWithMe,
      // sharedByMe,
      readOnly,
      disabled = false
    } = this.props
    const {
      downloadAlbum,
      deleteAlbum,
      // leaveAlbum,
      selectItems,
      onRename
    } = this.props
    return (
      <div className={styles['pho-toolbar']} role="toolbar">
        <div className={styles['u-hide--mob']}>
          <ShareButton
            disabled={disabled}
            label={t('Albums.share.cta')}
            onClick={this.showShareModal}
          />
        </div>
        <Menu
          disabled={disabled}
          className={styles['pho-toolbar-menu']}
          button={<MoreButton>{t('Toolbar.more')}</MoreButton>}
        >
          {!sharedWithMe && (
            <Item>
              <a
                className={classNames(
                  styles['pho-action-share'],
                  styles['u-hide--desk']
                )}
                onClick={this.showShareModal}
              >
                {t('Albums.share.cta')}
              </a>
            </Item>
          )}
          <Item>
            <a
              className={classNames(styles['pho-action-download'])}
              onClick={downloadAlbum}
            >
              {t('Toolbar.menu.download_album')}
            </a>
          </Item>
          <Item>
            <a
              className={classNames(styles['pho-action-rename'])}
              onClick={onRename}
            >
              {t('Toolbar.menu.rename_album')}
            </a>
          </Item>
          {!readOnly && (
            <Item>
              <Link
                className={classNames(styles['pho-action-addphotos'])}
                to={`${location.pathname}/edit`}
              >
                {t('Toolbar.menu.add_photos')}
              </Link>
            </Item>
          )}
          <hr className={styles['u-hide--desk']} />
          <Item>
            <a
              className={classNames(
                styles['pho-action-select'],
                styles['u-hide--desk']
              )}
              onClick={selectItems}
            >
              {t('Toolbar.menu.select_items')}
            </a>
          </Item>
          <hr />
          {!sharedWithMe && (
            <Item>
              <a
                className={classNames(styles['pho-action-delete'])}
                onClick={deleteAlbum}
              >
                {t('Toolbar.menu.album_delete')}
              </a>
            </Item>
          )}
          {/* sharedWithMe && (
            <Item>
              <a
                className={classNames(styles['pho-action-delete'])}
                onClick={leaveAlbum}
              >
                {t('Toolbar.menu.album_quit')}
              </a>
            </Item>
          ) */}
        </Menu>
        {this.state.showShareModal && (
          <ShareModal
            document={album}
            sharingDesc={album.name}
            onClose={this.closeShareModal}
          />
        )}
      </div>
    )
  }
}

export default withRouter(translate()(AlbumToolbar))
{'fraction_non_alphanumeric': 0.13477272727272727, 'fraction_numerical': 0.00045454545454545455, 'mean_word_length': 1.343808255659121, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 93, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7584331', 'n_tokens_mistral': 2460, 'n_tokens_neox': 2414, 'n_words': 348}