Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve color contrast on buttons #1021

Merged
merged 2 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 28 additions & 25 deletions src/files/FilesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,31 +231,34 @@ class FilesPage extends React.Component {
<Breadcrumbs path={files.path} onClick={doFilesNavigateTo} />

{ files.type === 'directory'
? <div className='ml-auto flex items-center'>
<Button
className='mr3 f6 pointer'
color='charcoal-muted'
bg='bg-transparent'
onClick={() => this.showNewFolderModal()}>
<FolderIcon viewBox='10 15 80 80' height='20px' className='fill-charcoal-muted w2 v-mid' />
<span className='fw3'>{t('newFolder')}</span>
</Button>
<FileInput
onAddFiles={this.add}
onAddByPath={this.addByPath}
addProgress={writeFilesProgress} />
</div>
: <div className='ml-auto' style={{ width: '1.5rem' }}> {/* to render correctly in Firefox */}
<ContextMenu
handleClick={this.handleContextMenuClick}
isOpen={this.state.isContextMenuOpen}
onShare={() => this.showShareModal(files.extra)}
onDelete={() => this.showDeleteModal(files.extra)}
onRename={() => this.showRenameModal(files.extra)}
onInspect={() => this.inspect(files.extra)}
onDownload={() => this.download(files.extra)}
hash={files.stats.hash} />
</div> }
? (
<div className='ml-auto flex items-center'>
<Button
className='mr3 f6 pointer'
color='charcoal-muted'
bg='bg-transparent'
onClick={() => this.showNewFolderModal()}>
<FolderIcon viewBox='10 15 80 80' height='20px' className='fill-charcoal-muted w2 v-mid' />
<span className='fw3'>{t('newFolder')}</span>
</Button>
<FileInput
onAddFiles={this.add}
onAddByPath={this.addByPath}
addProgress={writeFilesProgress} />
</div>
) : (
<div className='ml-auto' style={{ width: '1.5rem' }}> {/* to render correctly in Firefox */}
<ContextMenu
handleClick={this.handleContextMenuClick}
isOpen={this.state.isContextMenuOpen}
onShare={() => this.showShareModal(files.extra)}
onDelete={() => this.showDeleteModal(files.extra)}
onRename={() => this.showRenameModal(files.extra)}
onInspect={() => this.inspect(files.extra)}
onDownload={() => this.download(files.extra)}
hash={files.stats.hash} />
</div>
)}
</div>

{ isRoot && isCompanion && <CompanionInfo /> }
Expand Down
10 changes: 2 additions & 8 deletions src/files/file-input/FileInput.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import { translate } from 'react-i18next'
// Icons
import DocumentIcon from '../../icons/StrokeDocument'
Expand All @@ -14,17 +13,12 @@ import ByPathModal from './ByPathModal'

const AddButton = translate('files')(({ progress = null, t, tReady, i18n, lng, ...props }) => {
const sending = progress !== null
const cls = classnames({
'bg-grey light-grey': sending,
'pointer bg-green white': !sending
}, ['f6 relative'])

return (
<Button disabled={sending} className={cls} minWidth='120px' {...props}>
<Button bg='bg-navy' color='white' disabled={sending} className='f6 relative' minWidth='100px' {...props}>
<div className='absolute top-0 left-0 1 pa2 w-100 z-2'>
{ sending ? `${progress.toFixed(0)}%` : `+ ${t('addToIPFS')}` }
{ sending ? `${progress.toFixed(0)}%` : (<span><span style={{ color: '#8CDDE6' }}>+</span> {t('addToIPFS')}</span>) }
</div>&nbsp;

{ sending &&
<div className='transition-all absolute top-0 br1 left-0 h-100 z-1' style={{ width: `${progress}%`, background: 'rgba(0,0,0,0.1)' }} /> }
</Button>
Expand Down
4 changes: 3 additions & 1 deletion src/peers/AddConnection/AddConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ class AddConnection extends React.Component {

return (
<div>
<Button onClick={this.toggleModal} minWidth='160px' className='pointer bg-green white f6'>+ {t('addConnection')}</Button>
<Button onClick={this.toggleModal} className='f6 ph3' bg='bg-navy' color='white'>
<span style={{ color: '#8CDDE6' }}>+</span> {t('addConnection')}
</Button>

<Overlay show={open} onLeave={this.toggleModal}>
<TextInputModal
Expand Down