UX: better like button

Co-authored-by: jjaffeux <j.jaffeux@gmail.com>
This commit is contained in:
Arpit Jalan 2018-03-30 17:27:07 +05:30
parent a0386655a6
commit 4760f0e7a9
3 changed files with 58 additions and 17 deletions

View File

@ -285,8 +285,11 @@ export default createWidget('post-menu', {
replaceButton(orderedButtons, 'reply', 'wiki-edit');
}
orderedButtons.forEach(i => {
orderedButtons
.filter(x => x !== "like-count" && x !== "like")
.forEach(i => {
const button = this.attachButton(i, attrs);
if (button) {
allButtons.push(button);
@ -350,6 +353,11 @@ export default createWidget('post-menu', {
}
});
visibleButtons.unshift(h('div.like-button', [
this.attachButton("like-count", attrs),
this.attachButton("like", attrs)
]));
const postControls = [];
const repliesButton = this.attachButton('replies', attrs);

View File

@ -54,6 +54,34 @@ nav.post-controls {
padding: 0;
.like-button {
display: inline-block;
.widget-button {
background: none;
}
&:hover {
background: $primary-low;
.d-hover {
background: none;
}
}
&:active {
box-shadow: inset 0 1px 3px rgba(0,0,0, .4);
.widget-button {
box-shadow: none;
}
}
.like {
&:focus {
background: none;
}
}
.like-count {
font-size: $font-up-1;
i.fa-heart {
@ -64,7 +92,12 @@ nav.post-controls {
margin-right: -2px;
}
&.regular-likes {
margin-right: -15px;
margin-right: -12px;
}
}
.toggle-like {
padding: 8px 8px;
}
}

View File

@ -72,7 +72,7 @@ span.badge-posts {
margin-right: 5px;
}
&.regular-likes {
margin-right: -8px;
margin-right: -5px;
}
}
}