Skip to content

Commit dcff005

Browse files
committed
added getCollectionOwner
1 parent 04d348f commit dcff005

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

client/modules/User/components/Collection.jsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,18 @@ class Collection extends React.Component {
181181
}
182182

183183
getTitle() {
184-
const collectionTitle = this.props.t('Collection.Title');
185-
const titleSplits = collectionTitle.split('|');
186-
const title = titleSplits[0].concat('| ');
187-
return title;
184+
const title = this.props.t('Common.SiteName');
185+
const collectionTitle = title.concat(' | ');
186+
return collectionTitle;
187+
}
188+
189+
getCollectionOwner() {
190+
if (this.props.username === this.props.user.username) {
191+
return this.props.t('Collection.Title');
192+
}
193+
return this.props.t('Collection.AnothersTitle', {
194+
anotheruser: this.props.username
195+
});
188196
}
189197

190198
getUsername() {
@@ -406,7 +414,9 @@ class Collection extends React.Component {
406414
}
407415

408416
render() {
409-
const title = this.hasCollection() ? this.getCollectionName() : null;
417+
const title = this.hasCollection()
418+
? this.getCollectionName()
419+
: this.getCollectionOwner();
410420
const isOwner = this.isOwner();
411421

412422
return (

0 commit comments

Comments
 (0)