Skip to content

A platform for community discussion. Free, open, simple.

UX: show heart glyph on your own likes count

Arpit Jalana55b458e569c
diff --git a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 b/app/assets/javascripts/discourse/widgets/post-menu.js.es6
index fbd93ced0c8..93900f238f2 100644
--- a/app/assets/javascripts/discourse/widgets/post-menu.js.es6
+++ b/app/assets/javascripts/discourse/widgets/post-menu.js.es6
@@ -69,11 +69,15 @@ registerButton('like-count', attrs => {
const title = attrs.liked
? count === 1 ? 'post.has_likes_title_only_you' : 'post.has_likes_title_you'
: 'post.has_likes_title';
+ const icon = attrs.yours ? 'heart' : '';
+
return { action: 'toggleWhoLiked',
title,
className: 'like-count highlight-action',
contents: count,
+ icon,
+ iconRight: true,
titleOptions: {count: attrs.liked ? (count-1) : count }
};
}
diff --git a/app/assets/stylesheets/desktop/topic-post.scss b/app/assets/stylesheets/desktop/topic-post.scss
index 8b4c7d5969c..3a3fded4687 100644
--- a/app/assets/stylesheets/desktop/topic-post.scss
+++ b/app/assets/stylesheets/desktop/topic-post.scss
@@ -57,6 +57,10 @@ nav.post-controls {
.like-count {
font-size: $font-up-1;
margin-right: -15px;
+ i.fa-heart {
+ padding-left: 5px;
+ color: $love;
+ }
}
.highlight-action {
diff --git a/app/assets/stylesheets/mobile/topic-post.scss b/app/assets/stylesheets/mobile/topic-post.scss
index 3b48e5c91ec..bfb6feaa3cc 100644
--- a/app/assets/stylesheets/mobile/topic-post.scss
+++ b/app/assets/stylesheets/mobile/topic-post.scss
@@ -29,7 +29,7 @@ span.badge-posts {
.topic-post {
nav.post-controls {
clear: both;
- color: dark-light-choose($primary-low-mid, $secondary-high);
+ color: dark-light-choose($primary-low-mid, $secondary-high);
.d-icon {
opacity: 1.0;
}
@@ -51,7 +51,7 @@ span.badge-posts {
}
&.reply {
float: right;
- color: $primary-high;
+ color: $primary-high;
}
&.has-like {
color: $love;
@@ -64,6 +64,10 @@ span.badge-posts {
button.like-count {
font-size: $font-0;
padding: 8px 4px;
+ i.fa-heart {
+ padding-left: 5px;
+ color: $love;
+ }
}
}
}
@@ -404,7 +408,7 @@ blockquote {
}
.gap {
- padding: 0.25em 0;
+ padding: 0.25em 0;
}
.gutter { display: none; }