mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
Fixed avatar styling in conjunction with the size values
This commit is contained in:
parent
b3bde1aa2a
commit
c8002a2b9a
@ -29,6 +29,9 @@
|
||||
|
||||
<script>
|
||||
import helpers from './lib/helpers.js'
|
||||
import { tokens } from '@@/tokens'
|
||||
import camelCase from 'lodash/camelCase'
|
||||
import upperFirst from 'lodash/upperFirst'
|
||||
|
||||
export default {
|
||||
name: 'DsAvatar',
|
||||
@ -59,7 +62,7 @@ export default {
|
||||
return !this.name || this.name.toLowerCase() === 'anonymus'
|
||||
},
|
||||
styles() {
|
||||
let size = this.size
|
||||
let size = this.sizeValue
|
||||
if (Number.isInteger(Number(size))) {
|
||||
size = `${size}px`
|
||||
}
|
||||
@ -73,6 +76,9 @@ export default {
|
||||
color: this.fontColor
|
||||
}
|
||||
},
|
||||
sizeValue() {
|
||||
return tokens[`sizeAvatar${upperFirst(camelCase(this.size))}`]
|
||||
},
|
||||
hasImage() {
|
||||
return Boolean(this.image) && !this.error
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user