Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made bubble height width configurable through props. #945

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/embeds/js/src/features/bubble/components/Bubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export type BubbleProps = BotProps &
onOpen?: () => void
onClose?: () => void
onPreviewMessageClick?: () => void
height?: string
width?: string
}

export const Bubble = (props: BubbleProps) => {
Expand Down Expand Up @@ -148,7 +150,8 @@ export const Bubble = (props: BubbleProps) => {
<div
part="bot"
style={{
height: 'calc(100% - 80px)',
height: props.height ?? 'calc(100% - 80px)',
width: props.width ?? '100%!important',
prateekkalra marked this conversation as resolved.
Show resolved Hide resolved
transition:
'transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out',
'transform-origin':
Expand All @@ -159,7 +162,7 @@ export const Bubble = (props: BubbleProps) => {
'z-index': 42424242,
}}
class={
'fixed rounded-lg w-full sm:w-[400px] max-h-[704px]' +
'fixed rounded-lg sm:w-[400px] max-h-[704px]' +
(isBotOpened() ? ' opacity-1' : ' opacity-0 pointer-events-none') +
(props.theme?.button?.size === 'large'
? ' bottom-24'
Expand Down
2 changes: 2 additions & 0 deletions packages/embeds/js/src/features/bubble/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export type BubbleTheme = {
button?: ButtonTheme
previewMessage?: PreviewMessageTheme
placement?: 'left' | 'right'
height?: string
width?: string
}

export type ChatWindowTheme = {
Expand Down