Skip to content

Commit ca3ae01

Browse files
committed
Auto merge of #4067 - Turbo87:avatar, r=pichfl
UserAvatar: Replace `width` and `height` properties with `size` There is no point in having both if one is just an alias of the other one.
2 parents 32ccc7e + e5ef8fc commit ca3ae01

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

app/components/user-avatar.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<img
22
src={{this.src}}
3-
width={{this.width}}
4-
height={{this.height}}
3+
width={{this.size}}
4+
height={{this.size}}
55
alt={{this.alt}}
66
title={{this.title}}
77
...attributes

app/components/user-avatar.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { readOnly } from '@ember/object/computed';
21
import Component from '@glimmer/component';
32

43
export default class UserAvatar extends Component {
5-
get width() {
4+
get size() {
65
if (this.args.size === 'medium') {
76
return 85;
87
} else if (this.args.size === 'medium-small') {
@@ -12,8 +11,6 @@ export default class UserAvatar extends Component {
1211
}
1312
}
1413

15-
@readOnly('width') height;
16-
1714
get alt() {
1815
return this.args.user.name !== null
1916
? `${this.args.user.name} (${this.args.user.login})`
@@ -34,6 +31,6 @@ export default class UserAvatar extends Component {
3431
}
3532

3633
get src() {
37-
return `${this.args.user.avatar}&s=${this.width * 2}`;
34+
return `${this.args.user.avatar}&s=${this.size * 2}`;
3835
}
3936
}

0 commit comments

Comments
 (0)