Skip to content

Commit

Permalink
Fix metadata section separators
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Feb 8, 2019
1 parent 82c2325 commit a4eca1f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/components/metadata/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class MetadataPanel extends React.PureComponent {
return this.hasPhotoFields && (
<MetadataSection
onContextMenu={this.handlePhotoContextMenu}
separator
title="panel.metadata.photo">
<MetadataList
ref={this.setPhotoFields}
Expand All @@ -223,6 +224,7 @@ class MetadataPanel extends React.PureComponent {
return this.hasSelectionFields && (
<MetadataSection
onContextMenu={this.handleSelectionContextMenu}
separator
title="panel.metadata.selection">
<MetadataList
ref={this.setSelectionFields}
Expand Down
21 changes: 12 additions & 9 deletions src/components/metadata/section.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
'use strict'

const React = require('react')
const { func, node, number, string } = require('prop-types')
const { bool, func, node, number, string } = require('prop-types')
const { FormattedMessage } = require('react-intl')
const cx = require('classnames')


const MetadataSection = ({ children, count, onContextMenu, title }) => (
<section onContextMenu={onContextMenu}>
<h5 className="metadata-heading">
<FormattedMessage id={title} values={{ count }}/>
</h5>
{children}
</section>
)
const MetadataSection =
({ children, count, onContextMenu, separator, title }) => (
<section onContextMenu={onContextMenu}>
<h5 className={cx('metadata-heading', { separator })}>
<FormattedMessage id={title} values={{ count }}/>
</h5>
{children}
</section>
)

MetadataSection.propTypes = {
children: node.isRequired,
count: number,
onContextMenu: func,
separator: bool,
title: string.isRequired
}

Expand Down

0 comments on commit a4eca1f

Please sign in to comment.