Skip to content

Commit 095fbfd

Browse files
committed
Add links to user's page everywhere
1 parent 6ec7e75 commit 095fbfd

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

frontend/src/components/common/TweetPreview.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<img class="is-rounded" :src="tweet.author.avatar" alt="Author avatar">
1111
</router-link>
1212

13-
<DefaultAvatar v-else class="image is-64x64" :user="tweet.author" />
13+
<router-link v-else :to="{ name: 'user-page', params: { id: tweet.author.id } }">
14+
<DefaultAvatar class="image is-64x64" :user="tweet.author" />
15+
</router-link>
1416
</figure>
1517

1618
<div class="media-content">

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
<template>
2-
<div>
2+
<div v-if="tweet">
33
<article class="media box tweet">
44
<figure class="media-left">
5-
<p v-if="tweet.author.avatar" class="image is-64x64 is-square">
6-
<img class="is-rounded" :src="tweet.author.avatar">
7-
</p>
8-
<DefaultAvatar v-else class="image is-64x64" :user="tweet.author" />
5+
<router-link
6+
v-if="tweet.author.avatar"
7+
class="image is-64x64 is-square"
8+
:to="{ name: 'user-page', params: { id: tweet.author.id } }"
9+
>
10+
<img
11+
class="is-rounded"
12+
:src="tweet.author.avatar"
13+
alt="Author avatar"
14+
>
15+
</router-link>
16+
17+
<router-link v-else :to="{ name: 'user-page', params: { id: tweet.author.id } }">
18+
<DefaultAvatar class="image is-64x64" :user="tweet.author" />
19+
</router-link>
920
</figure>
1021

1122
<div class="media-content">

0 commit comments

Comments
 (0)