feat: Update UI for edit contact modal (#1833)

This commit is contained in:
Pranav Raj S
2021-02-27 12:33:12 +05:30
committed by GitHub
parent aab70bf1f1
commit d6391be4db
4 changed files with 29 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
<transition name="modal-fade">
<div
v-if="show"
class="modal-mask"
:class="modalClassName"
transition="modal"
@click="onBackDropClick"
>
@@ -30,6 +30,10 @@ export default {
type: Boolean,
default: false,
},
modalType: {
type: String,
default: 'centered',
},
},
computed: {
modalContainerClassName() {
@@ -39,6 +43,14 @@ export default {
}
return className;
},
modalClassName() {
const modalClassNameMap = {
centered: '',
'right-aligned': 'right-aligned',
};
return `modal-mask ${modalClassNameMap[this.modalType] || ''}`;
},
},
mounted() {
document.addEventListener('keydown', e => {
@@ -60,7 +72,7 @@ export default {
};
</script>
<style scoped>
<style scoped lang="scss">
.modal-container--full-width {
align-items: center;
border-radius: 0;
@@ -69,4 +81,14 @@ export default {
justify-content: center;
width: 100%;
}
.modal-mask.right-aligned {
justify-content: flex-end;
.modal-container {
border-radius: 0;
height: 100%;
width: 48rem;
}
}
</style>

View File

@@ -1,7 +1,7 @@
<template>
<form class="contact--form" @submit.prevent="handleSubmit">
<div class="row">
<div class="medium-9 columns">
<div class="columns">
<label :class="{ error: $v.name.$error }">
{{ $t('CONTACT_FORM.FORM.NAME.LABEL') }}
<input
@@ -37,14 +37,14 @@
<div class="row">
<woot-input
v-model.trim="phoneNumber"
class="medium-6 columns"
class="columns"
:label="$t('CONTACT_FORM.FORM.PHONE_NUMBER.LABEL')"
:placeholder="$t('CONTACT_FORM.FORM.PHONE_NUMBER.PLACEHOLDER')"
/>
</div>
<woot-input
v-model.trim="companyName"
class="medium-6 columns"
class="columns"
:label="$t('CONTACT_FORM.FORM.COMPANY_NAME.LABEL')"
:placeholder="$t('CONTACT_FORM.FORM.COMPANY_NAME.PLACEHOLDER')"
/>

View File

@@ -1,5 +1,5 @@
<template>
<woot-modal :show.sync="show" :on-close="onCancel">
<woot-modal :show.sync="show" :on-close="onCancel" modal-type="right-aligned">
<div class="column content-box">
<woot-modal-header
:header-title="$t('CREATE_CONTACT.TITLE')"

View File

@@ -1,5 +1,5 @@
<template>
<woot-modal :show.sync="show" :on-close="onCancel">
<woot-modal :show.sync="show" :on-close="onCancel" modal-type="right-aligned">
<div class="column content-box">
<woot-modal-header
:header-title="