Skip to content

Commit

Permalink
fix to show send icon as default
Browse files Browse the repository at this point in the history
  • Loading branch information
ninamarina committed Sep 6, 2024
1 parent d1f4205 commit 10e0dfd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export const argsData = {
],
skinTone: 'Default',
},
sendIcon: 'send',
sendIcon: undefined,
showCharacterLimit: {
count: 1000,
warning: 500,
Expand Down Expand Up @@ -238,6 +238,16 @@ export const Default = {
args: {},
};

export const SendButtonWithText = {
render: DefaultTemplate,
args: {
...argsData,
showSend: {
text: 'Save',
},
},
};

export const InitializeWithLineBreaks = {
render: DefaultTemplate,
args: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,26 @@
:class="[
{
'dt-message-input__send-button--disabled': isSendDisabled,
'd-btn--circle': hasSendIcon,
'd-btn--circle': showSendIcon,
},
]"
:aria-label="showSend.ariaLabel"
:aria-disabled="isSendDisabled"
@click="onSend"
>
<template
v-if="hasSendIcon"
v-if="showSendIcon"
#icon
>
<!-- @slot Slot for send button icon -->
<slot
name="sendIcon"
:icon-size="'300'"
/>
:icon-size="sendIconSize"
>
<dt-icon-send
:size="sendIconSize"
/>
</slot>
</template>
<template
v-if="showSend.text"
Expand All @@ -225,8 +229,7 @@ import { DtEmojiPicker } from '@/components/emoji_picker';
import { DtPopover } from '@/components/popover';
import { DtInput } from '@/components/input';
import { DtTooltip } from '@/components/tooltip';
import { DtIconImage, DtIconVerySatisfied, DtIconSatisfied } from '@dialpad/dialtone-icons/vue3';
import { hasSlotContent } from '@/common/utils';
import { DtIconImage, DtIconVerySatisfied, DtIconSatisfied, DtIconSend } from '@dialpad/dialtone-icons/vue3';

export default {
name: 'DtRecipeMessageInput',
Expand All @@ -241,6 +244,7 @@ export default {
DtIconImage,
DtIconVerySatisfied,
DtIconSatisfied,
DtIconSend,
},

mixins: [],
Expand Down Expand Up @@ -629,8 +633,8 @@ export default {
},

computed: {
hasSendIcon () {
return hasSlotContent(this.$slots.sendIcon);
showSendIcon () {
return !this.showSend.text;
},

inputLength () {
Expand Down Expand Up @@ -660,6 +664,10 @@ export default {
emojiPickerHovered () {
return this.emojiPickerFocus || this.emojiPickerOpened;
},

sendIconSize () {
return '300';
},
},

watch: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<span v-html="$attrs.top" />
</template>
<template
v-if="$attrs.sendIcon"
#sendIcon="{ iconSize }"
>
<dt-icon
Expand Down

0 comments on commit 10e0dfd

Please sign in to comment.