diff options
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/project_avatar/default.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/project_avatar/default.vue | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/project_avatar/default.vue b/app/assets/javascripts/vue_shared/components/project_avatar/default.vue new file mode 100644 index 00000000000..17927fabbcc --- /dev/null +++ b/app/assets/javascripts/vue_shared/components/project_avatar/default.vue @@ -0,0 +1,47 @@ +<script> +import Identicon from '../identicon.vue'; +import ProjectAvatarImage from './image.vue'; + +export default { + components: { + Identicon, + ProjectAvatarImage, + }, + props: { + project: { + type: Object, + required: true, + }, + size: { + type: Number, + default: 40, + }, + }, + computed: { + sizeClass() { + return `s${this.size}`; + }, + }, +}; +</script> + +<template> + <span + :class="sizeClass" + class="avatar-container project-avatar" + > + <project-avatar-image + v-if="project.avatar_url" + :link-href="project.path" + :img-src="project.avatar_url" + :img-alt="project.name" + :img-size="size" + /> + <identicon + v-else + :entity-id="project.id" + :entity-name="project.name" + :size-class="sizeClass" + /> + </span> +</template> |