Skip to content

Commit

Permalink
add GAvatar
Browse files Browse the repository at this point in the history
  • Loading branch information
ajatprabha committed Oct 14, 2018
1 parent 86d44e9 commit a3fa938
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Binary file added ui/src/assets/user_avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions ui/src/components/GAvatar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<img :src="link" alt="avatar">
</template>

<script>
import axios from 'axios'
import avatarPlaceholder from '../assets/user_avatar.png'
export default {
name: 'GAvatar',
props: ['email'],
data: () => ({link: avatarPlaceholder}),
methods: {
setLink () {
if (this.email) {
axios.get(`https://picasaweb.google.com/data/entry/api/user/${this.email}?alt=json`).then(response => {
this.link = response.data.entry.gphoto$thumbnail.$t
})
}
}
},
mounted () {
this.setLink()
}
}
</script>

<style scoped>
</style>

0 comments on commit a3fa938

Please sign in to comment.