logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

user_avatar.js (869B)


  1. import StillImage from '../still-image/still-image.vue'
  2. import { useInterfaceStore } from 'src/stores/interface'
  3. import { library } from '@fortawesome/fontawesome-svg-core'
  4. import {
  5. faRobot,
  6. faPeopleGroup
  7. } from '@fortawesome/free-solid-svg-icons'
  8. library.add(
  9. faRobot,
  10. faPeopleGroup
  11. )
  12. const UserAvatar = {
  13. props: [
  14. 'user',
  15. 'compact',
  16. 'showActorTypeIndicator'
  17. ],
  18. data () {
  19. return {
  20. showPlaceholder: false,
  21. defaultAvatar: `${this.$store.state.instance.server + this.$store.state.instance.defaultAvatar}`,
  22. betterShadow: useInterfaceStore().browserSupport.cssFilter
  23. }
  24. },
  25. components: {
  26. StillImage
  27. },
  28. methods: {
  29. imgSrc (src) {
  30. return (!src || this.showPlaceholder) ? this.defaultAvatar : src
  31. },
  32. imageLoadError () {
  33. this.showPlaceholder = true
  34. }
  35. }
  36. }
  37. export default UserAvatar