Skip to content

Commit e9ddde8

Browse files
committed
Fix message for no tags
1 parent 2230858 commit e9ddde8

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

js/components/blocks/TagsBlock.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,24 @@ const TagsBlock = React.createClass({
8383
const tagsStore = this.state.tagsStore;
8484
console.log('tagsList', tagsList);
8585
//
86-
let tags = 'There are no tags for now!';
86+
let tags = '';
87+
const isCurrentUser = this.props.openUser &&
88+
('github:' + this.props.openUser.id == this.props.uid);
89+
const isTagsListEmpty = tagsList && !tagsList.length;
90+
if (isCurrentUser && isTagsListEmpty) {
91+
tags = <p>You don't have any tags yet. Fell free to add them</p>;
92+
}
93+
else if (!isCurrentUser && isTagsListEmpty) {
94+
tags = <p>
95+
Unfortunately this user doesn't have any tags on githubify.
96+
Let him/her know about it on email:&nbsp;
97+
<a
98+
href={'mailto:' + this.props.openUser.email + '?subject=githubify.me'}
99+
>
100+
{this.props.openUser.email}
101+
</a>
102+
</p>;
103+
}
87104
if (tagsList && tagsList.length && this.props.openUser) {
88105
tags = _.map(tagsList, (tag) => {
89106
let activeClass = _.includes(tagsStore, tag.title) ?
@@ -108,13 +125,6 @@ const TagsBlock = React.createClass({
108125
);
109126
});
110127
}
111-
else if (tagsList && !tagsList.length) {
112-
tags = <p>
113-
Unfortunately this user doesn't have any tags on githubify.
114-
Let him/her know about it on email:&nbsp;
115-
<a href={'mailto:' + this.props.openUser.email + '?subject=githubify.me'}>{this.props.openUser.email}</a>
116-
</p>;
117-
}
118128
//
119129
return (
120130
<div className="tags-block">

less/components.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
.share-block {
5858
.center-block();
5959
display: table;
60-
margin-top: 20px;
6160
}
6261
@media (min-width: @screen-md) {
6362
text-align: right;

0 commit comments

Comments
 (0)