Skip to content

Commit

Permalink
fix(chat): give transparent images transparent background (#4898)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-power committed Sep 16, 2022
1 parent dfd73a3 commit 886c71e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/ui/Chat/Image/Image.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
v-else-if="dataURL"
class="image-container"
:nsfw="attachment.nsfw"
transparent
>
<img
:src="dataURL"
Expand Down
13 changes: 12 additions & 1 deletion components/ui/ImageContainer/ImageContainer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<div class="image-container" :class="{ nsfw: nsfw && blockNsfw }">
<div
class="image-container"
:class="{ nsfw: nsfw && blockNsfw, transparent: transparent }"
>
<slot />
</div>
</template>
Expand All @@ -13,6 +16,10 @@ export default {
type: Boolean,
default: false,
},
transparent: {
type: Boolean,
default: false,
},
},
computed: {
blockNsfw(): boolean {
Expand Down Expand Up @@ -44,5 +51,9 @@ export default {
filter: blur(40px);
}
}
&.transparent {
background: transparent;
}
}
</style>

0 comments on commit 886c71e

Please sign in to comment.