mirror of
https://github.com/enso-org/enso.git
synced 2024-11-05 03:59:38 +03:00
Remove Chat Placeholder when chat is hidden (#10209)
This commit is contained in:
parent
ed9651fc2b
commit
7744e8b464
@ -18,7 +18,7 @@ import Portal from '#/components/Portal'
|
||||
/** Props for a {@link Page}. */
|
||||
export interface PageProps extends Readonly<React.PropsWithChildren> {
|
||||
readonly hideInfoBar?: true
|
||||
readonly hideChat?: true
|
||||
readonly hideChat?: boolean
|
||||
}
|
||||
|
||||
/** A page. */
|
||||
@ -52,18 +52,21 @@ export default function Page(props: PageProps) {
|
||||
<InfoBar isHelpChatOpen={isHelpChatOpen} setIsHelpChatOpen={setIsHelpChatOpen} />
|
||||
</div>
|
||||
)}
|
||||
{/* `session.accessToken` MUST be present in order for the `Chat` component to work. */}
|
||||
{!hideInfoBar &&
|
||||
!hideChat &&
|
||||
session?.accessToken != null &&
|
||||
process.env.ENSO_CLOUD_CHAT_URL != null ? (
|
||||
<Chat
|
||||
isOpen={isHelpChatOpen}
|
||||
doClose={doCloseChat}
|
||||
endpoint={process.env.ENSO_CLOUD_CHAT_URL}
|
||||
/>
|
||||
) : (
|
||||
<ChatPlaceholder hideLoginButtons isOpen={isHelpChatOpen} doClose={doCloseChat} />
|
||||
{!hideChat && (
|
||||
<>
|
||||
{/* `session.accessToken` MUST be present in order for the `Chat` component to work. */}
|
||||
{!hideInfoBar &&
|
||||
session?.accessToken != null &&
|
||||
process.env.ENSO_CLOUD_CHAT_URL != null ? (
|
||||
<Chat
|
||||
isOpen={isHelpChatOpen}
|
||||
doClose={doCloseChat}
|
||||
endpoint={process.env.ENSO_CLOUD_CHAT_URL}
|
||||
/>
|
||||
) : (
|
||||
<ChatPlaceholder hideLoginButtons isOpen={isHelpChatOpen} doClose={doCloseChat} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<Portal>
|
||||
<div className="select-none text-xs text-primary">
|
||||
|
Loading…
Reference in New Issue
Block a user