Skip to content

Commit b6d4635

Browse files
authored
Merge pull request #62 from BinaryStudioAcademy/feature/fix-avatar-style
Fix avatar style in profile settings
2 parents 3117027 + fe3b4eb commit b6d4635

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

frontend/src/components/common/TweetPreview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class="image is-64x64 is-square"
88
:to="{ name: 'user-page', params: { id: tweet.author.id } }"
99
>
10-
<img class="is-rounded" :src="tweet.author.avatar" alt="Author avatar">
10+
<img class="is-rounded fit" :src="tweet.author.avatar" alt="Author avatar">
1111
</router-link>
1212

1313
<router-link v-else :to="{ name: 'user-page', params: { id: tweet.author.id } }">

frontend/src/components/view/profile/EditProfileForm.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<div class="tile is-ancestor">
44
<div class="tile is-parent">
55
<div class="tile is-child avatar">
6-
<div class="image is-square">
7-
<img v-if="user.avatar" class="image-avatar is-rounded" :src="user.avatar">
6+
<div class="image">
7+
<img v-if="user.avatar" class="image-avatar is-rounded fit" :src="user.avatar">
88
<DefaultAvatar v-else class="default-avatar" :user="user" />
99
<div class="actions">
1010
<b-upload

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class="image is-48x48 is-square"
77
:to="{ name: 'user-page', params: { id: comment.author.id } }"
88
>
9-
<img class="is-rounded" :src="comment.author.avatar">
9+
<img class="is-rounded fit" :src="comment.author.avatar">
1010
</router-link>
1111

1212
<router-link v-else :to="{ name: 'user-page', params: { id: comment.author.id } }">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<article class="media">
33
<figure class="media-left">
44
<p class="image is-48x48 is-square" v-if="user.avatar">
5-
<img class="is-rounded" :src="user.avatar">
5+
<img class="is-rounded fit" :src="user.avatar">
66
</p>
77
<DefaultAvatar v-else class="image is-48x48" :user="user" />
88
</figure>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
:to="{ name: 'user-page', params: { id: tweet.author.id } }"
99
>
1010
<img
11-
class="is-rounded"
11+
class="is-rounded fit"
1212
:src="tweet.author.avatar"
1313
alt="Author avatar"
1414
>

frontend/src/styles/common.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,10 @@ html, body {
4949
.auto-cursor {
5050
cursor: auto;
5151
}
52+
53+
.image img.fit {
54+
width: 100%;
55+
height: 100%;
56+
object-fit: cover;
57+
object-position: 50% 50%;
58+
}

0 commit comments

Comments
 (0)