Skip to content

Commit

Permalink
fix: files tab button fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelramalho19 committed Jun 3, 2020
1 parent c1f4d7e commit f3b3886
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/files/header/Header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import filesize from 'filesize'
import classNames from 'classnames'
import SimplifyNumber from 'simplify-number'
import { connect } from 'redux-bundler-react'
import { withTranslation } from 'react-i18next'
Expand All @@ -10,16 +11,13 @@ import Button from '../../components/button/Button'
// Icons
import GlyphDots from '../../icons/GlyphDots'

function BarOption ({ children, title, isLink = false, className = '', ...etc }) {
className += ' tc pa3'

if (etc.onClick) className += ' pointer'

function BarOption ({ children, title, isLink = false, className = '', onClick, ...etc }) {
const BarOptionsWrapper = onClick ? 'button' : 'div'
return (
<div className={className} {...etc}>
<BarOptionsWrapper className={classNames(className, 'tc pa3')} onClick={onClick} {...etc}>
<span className='nowrap db f4 navy'>{children}</span>
<span className={`db ttl ${isLink ? 'navy underline' : 'gray'}`}>{title}</span>
</div>
</BarOptionsWrapper>
)
}

Expand Down Expand Up @@ -47,7 +45,6 @@ class Header extends React.Component {
pins,
filesPathInfo,
filesSize,
repoNumObjects,
repoSize,
onNavigate
} = this.props
Expand All @@ -67,11 +64,7 @@ class Header extends React.Component {
{ pins ? SimplifyNumber(pins.length) : '-' }
</BarOption>

<BarOption title={t('blocks')}>
{ repoNumObjects ? SimplifyNumber(repoNumObjects, { decimal: 0 }) : 'N/A' }
</BarOption>

<BarOption title={t('repo')}>
<BarOption title={t('allBlocks')}>
{ humanSize(repoSize) }
</BarOption>

Expand Down

0 comments on commit f3b3886

Please sign in to comment.