Skip to content

Commit

Permalink
Merge pull request #227 from takenet/feature/609831-receptive-call
Browse files Browse the repository at this point in the history
feat(BlipCallsVoiceRequest): change voice request class name
  • Loading branch information
leonardogbr authored Mar 26, 2024
2 parents 1937e43 + 3395695 commit bcd20d1
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 31 deletions.
28 changes: 28 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@
<button class="button" @click="sendNoAnswerCallsVideoEnd">
ENVIAR Fim de chamada vídeo não respondida
</button>
<button class="button" @click="sendCallsVoiceRequest">
ENVIAR Solicitação de chamada
</button>
<button class="button" @click="sendRaw">
ENVIAR Unsupported Content
</button>
Expand Down Expand Up @@ -733,6 +736,31 @@ export default {
})
this.send()
},
sendCallsVoiceRequest() {
this.json = JSON.stringify({
id: '1',
to: '[email protected]',
type: 'application/json',
content: {
recipient_type: 'individual',
type: 'interactive',
interactive: {
type: 'voice_call',
body: {
text:
'Olá! Para um atendimento mais rápido, você pode entrar em contato através de uma chamada WhatsApp.'
},
action: {
name: 'voice_call',
parameters: {
display_text: 'Ligar agora'
}
}
}
}
})
this.send()
},
sendRaw: function() {
this.json = JSON.stringify({
id: '1',
Expand Down
61 changes: 30 additions & 31 deletions src/components/BlipCallsVoiceRequest.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<template>
<div :class="'blip-container ' + position">
<div :class="'bubble body ' + position">
<div :class="'blip-container calls-voice-request ' + position">
<div :class="'bubble ' + position">
<bds-typo
class="typo"
variant="fs-16"
bold="regular"
>{{ bodyText }}
</bds-typo>
<div class="action">
<bds-grid margin="y-1" direction="row" justify-content="center" padding="x-2">
<bds-icon v-if="position === 'right'" color="white" name="voip-call"/>
<bds-icon v-else name="voip-call"/>
<bds-typo
class="typo title-action"
variant="fs-16"
bold="regular">{{ actionText }}
</bds-typo>
</bds-grid>
<div class="action">
<bds-grid margin="y-1" direction="row" justify-content="center" padding="x-2">
<bds-icon v-if="position === 'right'" color="white" name="voip-call"/>
<bds-icon v-else name="voip-call"/>
<bds-typo
class="typo title-action"
variant="fs-16"
bold="regular">{{ actionText }}
</bds-typo>
</bds-grid>
</div>
</div>
</div>
</template>

<script>
export default {
name: 'blip-calls-voice-request',
props: {
Expand All @@ -40,27 +40,26 @@ export default {
}
</script>

<style lang="scss">
<style lang="scss" scoped>
@import '../styles/variables.scss';
.title-action {
margin-left: 8px;
}
.bubble {
max-width: 368px !important;
}
.blip-container.calls-voice-request {
.bubble {
text-align: left;
overflow: hidden;
padding: 10px 20px;
max-width: 368px !important;
}
.action {
text-align: center;
border-top: 1px solid $color-content-ghost;
margin-top: 10px;
padding-top: 12px;
}
.action {
text-align: center;
border-top: 1px solid $color-content-ghost;
margin-top: 10px;
padding-top: 12px;
.body {
text-align: left;
overflow: hidden;
padding: 10px 20px;
.title-action {
margin-left: 8px;
}
}
}
</style>

0 comments on commit bcd20d1

Please sign in to comment.