mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-20 13:05:16 +00:00
Fixes https://github.com/chatwoot/chatwoot/issues/8436 Fixes https://github.com/chatwoot/chatwoot/issues/9767 Fixes https://github.com/chatwoot/chatwoot/issues/10156 Fixes https://github.com/chatwoot/chatwoot/issues/6031 Fixes https://github.com/chatwoot/chatwoot/issues/5696 Fixes https://github.com/chatwoot/chatwoot/issues/9250 Fixes https://github.com/chatwoot/chatwoot/issues/9762 --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
72 lines
1.2 KiB
Vue
72 lines
1.2 KiB
Vue
<script>
|
|
export default {
|
|
props: {
|
|
url: { type: String, default: '' },
|
|
thumb: { type: String, default: '' },
|
|
readableTime: { type: String, default: '' },
|
|
},
|
|
methods: {
|
|
onImgError() {
|
|
this.$emit('error');
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<a
|
|
:href="url"
|
|
target="_blank"
|
|
rel="noreferrer noopener nofollow"
|
|
class="image"
|
|
>
|
|
<div class="wrap">
|
|
<img :src="thumb" alt="Picture message" @error="onImgError" />
|
|
<span class="time">{{ readableTime }}</span>
|
|
</div>
|
|
</a>
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
@import 'widget/assets/scss/variables.scss';
|
|
|
|
.image {
|
|
display: block;
|
|
|
|
.wrap {
|
|
position: relative;
|
|
display: flex;
|
|
max-width: 100%;
|
|
|
|
&::before {
|
|
background-image: linear-gradient(
|
|
-180deg,
|
|
transparent 3%,
|
|
$color-heading 130%
|
|
);
|
|
bottom: 0;
|
|
content: '';
|
|
height: 20%;
|
|
left: 0;
|
|
opacity: 0.8;
|
|
position: absolute;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
img {
|
|
width: 100%;
|
|
max-width: 250px;
|
|
}
|
|
|
|
.time {
|
|
font-size: $font-size-small;
|
|
bottom: $space-smaller;
|
|
color: $color-white;
|
|
position: absolute;
|
|
right: $space-slab;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
</style>
|