debian-mirror-gitlab/app/assets/javascripts/vue_shared/components/project_avatar.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
827 B
Vue
Raw Normal View History

2021-09-30 23:02:18 +05:30
<script>
import { GlAvatar } from '@gitlab/ui';
2022-06-21 17:19:12 +05:30
import { AVATAR_SHAPE_OPTION_RECT } from '~/vue_shared/constants';
2021-09-30 23:02:18 +05:30
export default {
components: {
GlAvatar,
},
props: {
projectName: {
type: String,
required: true,
},
projectAvatarUrl: {
type: String,
required: false,
default: '',
},
size: {
type: Number,
default: 32,
required: false,
},
alt: {
type: String,
required: false,
default: undefined,
},
},
computed: {
avatarAlt() {
return this.alt ?? this.projectName;
},
},
2022-06-21 17:19:12 +05:30
AVATAR_SHAPE_OPTION_RECT,
2021-09-30 23:02:18 +05:30
};
</script>
<template>
<gl-avatar
2022-06-21 17:19:12 +05:30
:shape="$options.AVATAR_SHAPE_OPTION_RECT"
2021-09-30 23:02:18 +05:30
:entity-name="projectName"
:src="projectAvatarUrl"
:alt="avatarAlt"
:size="size"
/>
</template>