Skip to content

Commit

Permalink
fix: fix chat stage rendering conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
anfibiacreativa committed Dec 7, 2023
1 parent fdcc73b commit ba18c36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
17 changes: 8 additions & 9 deletions packages/chat-component/src/components/chat-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,14 @@ export class ChatComponent extends LitElement {
return html`
<div id="overlay" class="overlay"></div>
<section id="chat__containerWrapper" class="chat__containerWrapper">
${this.isCustomBranding && !this.isChatStarted
? html` <chat-stage
svgIcon="${iconLogo}"
pagetitle="${globalConfig.BRANDING_HEADLINE}"
url="${globalConfig.BRANDING_URL}"
>
</chat-stage>`
: ''}
<section class="chat__container" id="chat-container">
${this.isChatStarted
? html`
Expand Down Expand Up @@ -441,15 +449,6 @@ export class ChatComponent extends LitElement {
: ''}
<!-- Teaser List with Default Prompts -->
<div class="chat__container">
${this.isChatStarted && this.isCustomBranding
? ''
: html` <chat-stage
.isEnabled="${this.isCustomBranding}"
svgIcon="${iconLogo}"
pagetitle="${globalConfig.BRANDING_HEADLINE}"
url="${globalConfig.BRANDING_URL}"
>
</chat-stage>`}
<!-- Conditionally render default prompts based on isDefaultPromptsEnabled -->
${this.isDefaultPromptsEnabled
? html`
Expand Down
7 changes: 2 additions & 5 deletions packages/chat-component/src/components/chat-stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { styles } from '../styles/chat-stage.js';
import './link-icon.js';
export interface ChatStage {
pagetitle: string;
url: string;
svgIcon: string;
isEnabled: boolean;
}

@customElement('chat-stage')
Expand All @@ -18,16 +18,13 @@ export class ChatStageComponent extends LitElement {
@property({ type: String })
url = '';

@property({ type: Boolean })
isEnabled = false;

@property({ type: String })
svgIcon = '';

override render() {
return html`
<header class="chat-stage__header">
<link-icon url="${this.url}" svgIcon="${this.svgIcon}" isEnabled="${this.isEnabled}"></link-icon>
<link-icon url="${this.url}" svgIcon="${this.svgIcon}"></link-icon>
<h1 class="chat-stage__hl">${this.pagetitle}</h1>
</header>
`;
Expand Down

0 comments on commit ba18c36

Please sign in to comment.