chat_avatar.js (797B)
1 import StillImage from '../still-image/still-image.vue' 2 import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' 3 import { mapState } from 'vuex' 4 5 const ChatAvatar = { 6 props: ['users', 'fallbackUser', 'width', 'height'], 7 components: { 8 StillImage 9 }, 10 methods: { 11 getUserProfileLink (user) { 12 return generateProfileLink(user.id, user.screen_name) 13 } 14 }, 15 computed: { 16 firstUser () { 17 return this.users[0] || this.fallbackUser 18 }, 19 secondUser () { 20 return this.users[1] 21 }, 22 thirdUser () { 23 return this.users[2] 24 }, 25 fourthUser () { 26 return this.users[3] 27 }, 28 ...mapState({ 29 betterShadow: state => state.interface.browserSupport.cssFilter 30 }) 31 } 32 } 33 34 export default ChatAvatar