feat: Add multiline support for channel greeting message (#2952)

This commit is contained in:
Fayaz Ahmed 2021-09-08 15:07:24 +05:30 committed by GitHub
parent 41314157c2
commit 2821777e93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 174 additions and 57 deletions

View file

@ -0,0 +1,78 @@
<template>
<section>
<label v-if="richtext" class="greetings--richtext">
<woot-message-editor
v-model="greetingsMessage"
:is-format-mode="true"
class="input"
:placeholder="placeholder"
:min-height="4"
@input="handleInput"
/>
</label>
<resizable-text-area
v-else
v-model="greetingsMessage"
rows="4"
type="text"
class="medium-9 greetings--textarea"
:label="label"
:placeholder="placeholder"
@input="handleInput"
/>
</section>
</template>
<script>
import WootMessageEditor from 'dashboard/components/widgets/WootWriter/Editor';
import ResizableTextArea from 'shared/components/ResizableTextArea';
export default {
components: {
WootMessageEditor,
ResizableTextArea,
},
props: {
value: {
type: String,
default: '',
},
richtext: {
type: Boolean,
default: false,
},
label: {
type: String,
default: '',
},
placeholder: {
type: String,
default: '',
},
},
data() {
return {
greetingsMessage: this.value,
};
},
watch: {
value: function (newValue) {
this.greetingsMessage = newValue;
},
},
methods: {
handleInput() {
this.$emit('input', this.greetingsMessage);
},
},
};
</script>
<style scoped>
.greetings--richtext {
padding: 0 var(--space-normal);
border-radius: var(--border-radius-normal);
border: 1px solid var(--color-border);
margin: 0 0 var(--space-normal);
}
</style>