Skip to content

Commit e0a2079

Browse files
Allow variable size for project logo component (#3478)
The project logo component is currently hardcoded to a width of 8. Upcoming use cases for this component require different widths. This PR restructures the component to specify a 1:1 aspect ratio, while leaving exact widths and other styling up to the user.
1 parent 0125f98 commit e0a2079

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

resources/js/vue/components/ProjectsPage.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
<project-logo
6969
:image-url="project.logoUrl"
7070
:project-name="project.name"
71+
class="tw-w-8"
7172
/>
7273
</td>
7374
<td class="tw-align-middle tw-w-full">

resources/js/vue/components/shared/ProjectLogo.vue

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
<template>
2-
<div v-if="imageUrl">
3-
<div class="tw-rounded tw-w-8">
4-
<img
5-
:alt="projectName + ' logo'"
6-
:src="imageUrl"
7-
>
8-
</div>
9-
</div>
10-
<div
11-
v-else
12-
class="tw-avatar tw-placeholder"
13-
>
2+
<div class="tw-aspect-square tw-rounded tw-overflow-hidden">
3+
<img
4+
v-if="imageUrl"
5+
:alt="projectName + ' logo'"
6+
:src="imageUrl"
7+
class="tw-w-full tw-h-full tw-object-cover"
8+
>
149
<div
15-
class="tw-rounded tw-w-8"
10+
v-else
11+
class="tw-w-full tw-h-full tw-flex tw-items-center tw-justify-center"
1612
:class="placeholderColorClass"
1713
>
1814
<span>{{ projectName[0].toUpperCase() }}</span>

0 commit comments

Comments
 (0)