Skip to content

Commit

Permalink
chore: centered buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelramalho19 committed Jun 9, 2020
1 parent 5074350 commit 707f81f
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 40 deletions.
4 changes: 2 additions & 2 deletions src/components/ask/AskToEnable.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const AskToEnable = ({ className, label, yesLabel, noLabel, onYes, onNo, details
)}
</span>
<span className='dib'>
<Button className='ml3 mv1' bg={'bg-green'} onClick={onYes}>{yesLabel}</Button>
<Button className='ml3 mv1' color='charcoal' bg={'bg-snow-muted'} onClick={onNo}>{noLabel}</Button>
<Button className='ml3 mv1 tc' bg={'bg-green'} onClick={onYes}>{yesLabel}</Button>
<Button className='ml3 mv1 tc' color='charcoal' bg={'bg-snow-muted'} onClick={onNo}>{noLabel}</Button>
</span>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/language-selector/LanguageSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LanguageSelector extends Component {
<div className='ph4 flex items-center bg-white lh-copy charcoal f6 fw5' style={{ height: 40 }}>
{getCurrentLanguage()}
</div>
<Button minWidth={100} onClick={this.onLanguageEditOpen}>
<Button className="tc" minWidth={100} onClick={this.onLanguageEditOpen}>
{t('actions.edit')}
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const LanguageModal = ({ t, tReady, onLeave, link, className, ...props }) => {
{ localesList.map((lang) =>
<button
key={`lang-${lang}`}
className='pa2 w-33 flex nowrap bg-transparent bn outline-0 blue'
className='pa2 w-33 flex nowrap bg-transparent bn outline-0 blue justify-center'
onClick={() => handleClick(lang)}>
{ getLanguage(lang) }
</button>
Expand All @@ -35,7 +35,7 @@ const LanguageModal = ({ t, tReady, onLeave, link, className, ...props }) => {
</ModalBody>

<ModalActions>
<Button className='ma2' bg='bg-gray' onClick={onLeave}>{t('actions.close')}</Button>
<Button className='ma2 tc' bg='bg-gray' onClick={onLeave}>{t('actions.close')}</Button>
</ModalActions>
</Modal>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/text-input-modal/TextInputModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class TextInputModal extends React.Component {
</ModalBody>

<ModalActions>
<Button className='ma2' bg='bg-gray' onClick={onCancel}>Cancel</Button>
<Button className='ma2' bg='bg-teal' disabled={this.isDisabled} onClick={this.onSubmit}>{submitText}</Button>
<Button className='ma2 tc' bg='bg-gray' onClick={onCancel}>Cancel</Button>
<Button className='ma2 tc' bg='bg-teal' disabled={this.isDisabled} onClick={this.onSubmit}>{submitText}</Button>
</ModalActions>
</Modal>
)
Expand Down
46 changes: 23 additions & 23 deletions src/files/context-menu/ContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,22 @@ class ContextMenu extends React.Component {
translateY={-translateY}
open={this.props.isOpen}
onDismiss={this.props.handleClick}>
{ !isUpperDir && !isUnknown && isMfs && onDelete &&
<Option onClick={this.wrap('onDelete')}>
<StrokeTrash className='w2 mr2 fill-aqua' />
{t('actions.delete')}
{ !isUpperDir && onShare &&
<Option onClick={this.wrap('onShare')}>
<StrokeShare className='w2 mr2 fill-aqua' />
{t('actions.share')}
</Option>
}
{ !isUpperDir && !isUnknown && isMfs && onRename &&
<Option onClick={this.wrap('onRename')}>
<StrokePencil className='w2 mr2 fill-aqua' />
{t('actions.rename')}
<CopyToClipboard text={this.props.hash} onCopy={this.props.handleClick}>
<Option>
<StrokeCopy className='w2 mr2 fill-aqua' />
{t('actions.copyHash')}
</Option>
</CopyToClipboard>
{ onInspect &&
<Option onClick={this.wrap('onInspect')}>
<StrokeIpld className='w2 mr2 fill-aqua' />
{t('actions.inspect')}
</Option>
}
{ !isUpperDir && !isUnknown && onDownload &&
Expand All @@ -73,26 +79,20 @@ class ContextMenu extends React.Component {
{t('actions.download')}
</Option>
}
{ onInspect &&
<Option onClick={this.wrap('onInspect')}>
<StrokeIpld className='w2 mr2 fill-aqua' />
{t('actions.inspect')}
</Option>
}
<Option onClick={this.wrap(pinned ? 'onUnpin' : 'onPin')}>
<StrokePin className='w2 mr2 fill-aqua' />
{ pinned ? t('actions.unpin') : t('actions.pin') }
</Option>
<CopyToClipboard text={this.props.hash} onCopy={this.props.handleClick}>
<Option>
<StrokeCopy className='w2 mr2 fill-aqua' />
{t('actions.copyHash')}
{ !isUpperDir && !isUnknown && isMfs && onRename &&
<Option onClick={this.wrap('onRename')}>
<StrokePencil className='w2 mr2 fill-aqua' />
{t('actions.rename')}
</Option>
</CopyToClipboard>
{ !isUpperDir && onShare &&
<Option onClick={this.wrap('onShare')}>
<StrokeShare className='w2 mr2 fill-aqua' />
{t('actions.share')}
}
{ !isUpperDir && !isUnknown && isMfs && onDelete &&
<Option onClick={this.wrap('onDelete')}>
<StrokeTrash className='w2 mr2 fill-aqua' />
{t('actions.delete')}
</Option>
}
</DropdownMenu>
Expand Down
4 changes: 2 additions & 2 deletions src/files/explore-form/FilesExploreForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class FilesExploreForm extends React.Component {
style={{ borderRadius: '0 3px 3px 0' }}
onClick={this.onInspect}
bg='bg-teal'
className='ExploreFormButton button-reset pv1 ph2 ba f7 fw4 white overflow-hidden' >
className='ExploreFormButton button-reset pv1 ph2 ba f7 fw4 white overflow-hidden tc' >
<StrokeIpld style={{ height: 24 }} className='dib fill-current-color v-mid' />
<span className='ml2'>{t('exploreForm.inspect')}</span>
</Button>
Expand All @@ -103,7 +103,7 @@ class FilesExploreForm extends React.Component {
style={{ borderRadius: '0' }}
title={t('exploreForm.browse')}
onClick={this.onBrowse}
className='ExploreFormButton button-reset pv1 ph2 ba f7 fw4 white bg-gray overflow-hidden' >
className='ExploreFormButton button-reset pv1 ph2 ba f7 fw4 white bg-gray overflow-hidden tc' >
<StrokeFolder style={{ height: 24 }} className='dib fill-current-color v-mid' />
<span className='ml2'>{t('exploreForm.browse')}</span>
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/files/header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Header extends React.Component {
<Button bg='bg-navy'
color='white'
fill='fill-aqua'
className='f6 relative flex justify-center items-center'
className='f6 relative flex justify-center items-center tc'
minWidth='100px'
disabled={!files || filesPathInfo.isRoot || files.type === 'unknown'}
onClick={this.handleContextMenu}>
Expand Down
4 changes: 2 additions & 2 deletions src/files/modals/delete-modal/DeleteModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const DeleteModal = ({ t, tReady, onCancel, onDelete, folders, files, className,
</ModalBody>

<ModalActions>
<Button className='ma2' bg='bg-gray' onClick={onCancel}>{t('actions.cancel')}</Button>
<Button className='ma2' bg='bg-red' onClick={onDelete}>{t('actions.delete')}</Button>
<Button className='ma2 tc' bg='bg-gray' onClick={onCancel}>{t('actions.cancel')}</Button>
<Button className='ma2 tc' bg='bg-red' onClick={onDelete}>{t('actions.delete')}</Button>
</ModalActions>
</Modal>
)
Expand Down
4 changes: 2 additions & 2 deletions src/files/modals/share-modal/ShareModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const ShareModal = ({ t, tReady, onLeave, link, className, ...props }) => (
</ModalBody>

<ModalActions>
<Button className='ma2' bg='bg-gray' onClick={onLeave}>{t('actions.close')}</Button>
<Button className='ma2 tc' bg='bg-gray' onClick={onLeave}>{t('actions.close')}</Button>
<CopyToClipboard text={link} onCopy={onLeave}>
<Button className='ma2'>{t('actions.copy')}</Button>
<Button className='ma2 tc'>{t('actions.copy')}</Button>
</CopyToClipboard>
</ModalActions>
</Modal>
Expand Down
2 changes: 1 addition & 1 deletion src/peers/AddConnection/AddConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AddConnection extends React.Component {

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

Expand Down
3 changes: 2 additions & 1 deletion src/settings/SettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const SettingsPage = ({
minWidth={100}
height={40}
bg='bg-charcoal'
className='tc'
disabled={isSaving || (!hasLocalChanges && !hasExternalChanges)}
onClick={onReset}>
{t('reset')}
Expand Down Expand Up @@ -112,7 +113,7 @@ const SaveButton = ({ t, hasErrors, hasSaveFailed, hasSaveSucceded, isSaving, ha
<Button
minWidth={100}
height={40}
className='mt2 mt0-l ml2-l'
className='mt2 mt0-l ml2-l tc'
bg={bg}
disabled={!hasLocalChanges || hasErrors}
danger={hasSaveFailed || hasExternalChanges}
Expand Down
2 changes: 1 addition & 1 deletion src/welcome/WelcomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class ApiAddressForm extends React.Component {
onKeyPress={this.onKeyPress}
value={this.state.value} />
<div className='tr'>
<Button>{t('apiAddressForm.submitButton')}</Button>
<Button className="tc">{t('apiAddressForm.submitButton')}</Button>
</div>
</form>
)
Expand Down

0 comments on commit 707f81f

Please sign in to comment.