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 { .modal-image {
max-width: 80%; max-width: 85%;
} }
&::before { &::before {

View file

@ -6,7 +6,7 @@
transition="modal" transition="modal"
@click="onBackDropClick" @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> <i class="ion-android-close modal--close" @click="close"></i>
<slot /> <slot />
</div> </div>
@ -26,9 +26,18 @@ export default {
type: Function, type: Function,
required: true, required: true,
}, },
className: { fullWidth: {
type: String, type: Boolean,
default: '', default: false,
},
},
computed: {
modalContainerClassName() {
let className = 'modal-container';
if (this.fullWidth) {
return `${className} modal-container--full-width`;
}
return className;
}, },
}, },
mounted() { mounted() {
@ -50,3 +59,14 @@ export default {
}, },
}; };
</script> </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> <template>
<div class="image message-text__wrap"> <div class="image message-text__wrap">
<img :src="url" @click="onClick" /> <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" /> <img :src="url" class="modal-image" />
</woot-modal> </woot-modal>
</div> </div>