Skip to content

Commit

Permalink
feat(web): allow fullscreen mode with embedded (#11607)
Browse files Browse the repository at this point in the history
* feat(web): allow fullscreen mode with embedded

* pr comments
  • Loading branch information
davidvitora committed Mar 11, 2022
1 parent d86ce8c commit 3f656ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/channel-web/assets/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ function _injectDOMElement(tagName, selector, options) {
function _generateIFrameHTML(host, config) {
const botId = config.botId || ''
const options = encodeURIComponent(JSON.stringify({ config: config }))
let iframeSrc = host + '/lite/' + botId + '/?m=channel-web&v=Embedded&options=' + options
const viewMode = config.viewMode || 'Embedded'
let iframeSrc = host + '/lite/' + botId + '/?m=channel-web&v=' + viewMode + '&options=' + options
if (config.ref) {
iframeSrc += '&ref=' + encodeURIComponent(config.ref)
}
Expand Down
4 changes: 4 additions & 0 deletions modules/channel-web/src/views/lite/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ export interface Config {
chatId?: string
/** CSS class to be applied to iframe */
className?: string
/** Force the display to use a specific mode (Fullscreen or Embedded)
* Defaults to 'Embedded'
*/
viewMode?: 'Embedded' | 'Fullscreen'
}

type OverridableComponents = 'below_conversation' | 'before_container' | 'composer'
Expand Down

0 comments on commit 3f656ec

Please sign in to comment.