fix: Add a full width image view to fix resolution issues (#1363)

This commit is contained in:
Pranav Raj S 2020-10-26 00:28:23 +05:30 committed by GitHub
parent 54214c73aa
commit fa864cc9ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 6 deletions

View file

@ -34,7 +34,7 @@
}
.modal-image {
max-width: 80%;
max-width: 85%;
}
&::before {

View file

@ -6,7 +6,7 @@
transition="modal"
@click="onBackDropClick"
>
<div class="modal-container" :class="className" @click.stop>
<div :class="modalContainerClassName" @click.stop>
<i class="ion-android-close modal--close" @click="close"></i>
<slot />
</div>
@ -26,9 +26,18 @@ export default {
type: Function,
required: true,
},
className: {
type: String,
default: '',
fullWidth: {
type: Boolean,
default: false,
},
},
computed: {
modalContainerClassName() {
let className = 'modal-container';
if (this.fullWidth) {
return `${className} modal-container--full-width`;
}
return className;
},
},
mounted() {
@ -50,3 +59,14 @@ export default {
},
};
</script>
<style scoped>
.modal-container--full-width {
align-items: center;
border-radius: 0;
display: flex;
height: 100%;
justify-content: center;
width: 100%;
}
</style>

View file

@ -1,7 +1,7 @@
<template>
<div class="image message-text__wrap">
<img :src="url" @click="onClick" />
<woot-modal :show.sync="show" :on-close="onClose">
<woot-modal :full-width="true" :show.sync="show" :on-close="onClose">
<img :src="url" class="modal-image" />
</woot-modal>
</div>