Enhancement: Add close button to the contact sidebar panel (#551)

This commit is contained in:
Nithin David Thomas
2020-02-23 21:13:28 +05:30
committed by GitHub
parent 2d3212575d
commit fd8e8c7c87
2 changed files with 21 additions and 0 deletions

View File

@@ -1,6 +1,9 @@
<template> <template>
<div class="medium-3 bg-white contact--panel"> <div class="medium-3 bg-white contact--panel">
<div class="contact--profile"> <div class="contact--profile">
<span class="close-button" @click="onPanelToggle">
<i class="ion-close-round"></i>
</span>
<div class="contact--info"> <div class="contact--info">
<thumbnail <thumbnail
:src="contact.thumbnail" :src="contact.thumbnail"
@@ -101,6 +104,10 @@ export default {
type: [Number, String], type: [Number, String],
required: true, required: true,
}, },
onToggle: {
type: Function,
default: () => {},
},
}, },
computed: { computed: {
currentConversationMetaData() { currentConversationMetaData() {
@@ -152,6 +159,11 @@ export default {
id: this.currentConversationMetaData.contact_id, id: this.currentConversationMetaData.contact_id,
}); });
}, },
methods: {
onPanelToggle() {
this.onToggle();
},
},
}; };
</script> </script>
@@ -165,8 +177,16 @@ export default {
overflow-y: auto; overflow-y: auto;
background: white; background: white;
overflow: auto; overflow: auto;
position: relative;
} }
.close-button {
position: absolute;
right: $space-slab;
top: $space-slab;
font-size: $font-size-default;
color: $color-heading;
}
.contact--profile { .contact--profile {
padding: $space-medium $space-normal 0 $space-medium; padding: $space-medium $space-normal 0 $space-medium;
align-items: center; align-items: center;

View File

@@ -14,6 +14,7 @@
<contact-panel <contact-panel
v-if="isContactPanelOpen" v-if="isContactPanelOpen"
:conversation-id="conversationId" :conversation-id="conversationId"
:on-toggle="onToggleContactPanel"
/> />
</section> </section>
</template> </template>