Skip to content

Commit 074c36e

Browse files
committed
Fix normalizer, include likes count
Fix tweet preview styles
1 parent 38140ee commit 074c36e

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

frontend/src/components/common/TweetPreview.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
</div>
3232

3333
<nav class="level is-mobile">
34-
<div class="level-left">
35-
<a class="level-item">
34+
<div class="level-left auto-cursor">
35+
<a class="level-item auto-cursor">
3636
<span class="icon is-medium has-text-info">
3737
<font-awesome-icon icon="comments" />
3838
</span>
3939
{{ tweet.commentsCount }}
4040
</a>
41-
<a class="level-item">
41+
<a class="level-item auto-cursor">
4242
<span class="icon is-medium has-text-info">
4343
<font-awesome-icon icon="heart" />
4444
</span>

frontend/src/components/view/tweet/TweetContainer.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
<br>
3535
</p>
3636

37-
<nav class="level is-mobile">
37+
<nav class="level is-mobile activity">
3838
<div class="level-left">
39-
<a class="level-item">
39+
<a class="level-item auto-cursor">
4040
<span
4141
class="icon is-medium has-text-info"
4242
:class="{ 'has-text-danger': tweetIsCommentedByUser(tweet.id, user.id) }"
@@ -49,7 +49,7 @@
4949
<span class="icon is-medium has-text-info">
5050
<font-awesome-icon icon="heart" />
5151
</span>
52-
{{ tweet.likes_count || 0 }}
52+
{{ tweet.likesCount }}
5353
</a>
5454
</div>
5555
</nav>
@@ -194,6 +194,7 @@ export default {
194194

195195
<style lang="scss" scoped>
196196
@import "~bulma/sass/utilities/initial-variables";
197+
@import "../../../styles/common";
197198
198199
.tweet-image {
199200
margin: 12px 0 0 0;
@@ -215,4 +216,14 @@ export default {
215216
.tweet-text {
216217
max-width: 100%;
217218
}
219+
220+
.activity {
221+
margin-bottom: 16px;
222+
}
223+
224+
.content {
225+
figure {
226+
margin-top: 0;
227+
}
228+
}
218229
</style>

frontend/src/services/Normalizer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ export const commentMapper = comment => ({
1414
created: comment.created_at,
1515
updated: comment.updated_at,
1616
author: userMapper(comment.author),
17-
likesCount: comment.likes_count
1817
});
1918

2019
export const tweetMapper = tweet => ({
2120
...tweet,
2221
imageUrl: tweet.image_url,
2322
created: tweet.created_at,
2423
author: userMapper(tweet.author),
25-
commentsCount: tweet.comments_count
24+
commentsCount: tweet.comments_count,
25+
likesCount: tweet.likes_count
2626
});

frontend/src/styles/common.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ html, body {
4545
padding-right: 10px;
4646
padding-bottom: 20px;
4747
}
48+
49+
.auto-cursor {
50+
cursor: auto;
51+
}

0 commit comments

Comments
 (0)