Skip to content

Commit

Permalink
Remove leading space from bracketed output
Browse files Browse the repository at this point in the history
See the comments in
metabrainz#630
  • Loading branch information
mwiencek authored and reosarevok committed Apr 12, 2018
1 parent 6ac2bec commit 222d4fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions root/static/scripts/common/components/EntityLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const EventDisambiguation = ({event}: {|+event: EventT|}) => {
}
return (
<Frag>
{dates ? bracketed(dates) : null}
{dates ? ' ' + bracketed(dates) : null}
{event.cancelled
? <Comment className="cancelled" comment={l('cancelled')} />
: null}
Expand Down Expand Up @@ -122,7 +122,7 @@ const EntityLink = ({
}

if (entity.entityType === 'artist' && !nonEmpty(hover)) {
hover = entity.sort_name + bracketed(comment);
hover = entity.sort_name + (comment ? ' ' + bracketed(comment) : '');
}

if (entity.entityType === 'area') {
Expand Down
2 changes: 1 addition & 1 deletion root/static/scripts/common/utility/bracketed.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Args = $Shape<{

export default function bracketed(text: ?ReactNode, args: Args = {}) {
if (text) {
return l(' ({text})', {text, ...args});
return l('({text})', {text, ...args});
}
return '';
}

0 comments on commit 222d4fb

Please sign in to comment.