-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-async-event-handlers
- Loading branch information
Showing
9 changed files
with
71 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,6 @@ | |
z-index: 9999; | ||
} | ||
|
||
/* ChatBot Commons */ | ||
|
||
|
||
/* Chat Window */ | ||
|
||
.rcb-chat-window { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/components/ChatBotToast/ToastContainer/ToastContainer.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Toast Container */ | ||
|
||
.rcb-toast-prompt-container { | ||
position: absolute; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
bottom: 0px; | ||
margin: auto; | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
flex-direction: column; | ||
opacity: 1; | ||
animation: popIn 0.3s ease-in-out; | ||
pointer-events: auto; | ||
margin-top: 200; | ||
} |
44 changes: 44 additions & 0 deletions
44
src/components/ChatBotToast/ToastContainer/ToastContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { CSSProperties } from "react"; | ||
|
||
import ToastPrompt from "../ToastPrompt/ToastPrompt"; | ||
import { useStylesContext } from "../../../context/StylesContext"; | ||
import { useToastsContext } from "../../../context/ToastsContext"; | ||
|
||
import "./ToastContainer.css"; | ||
|
||
/** | ||
* Holds toast prompts. | ||
* | ||
*/ | ||
const ToastContainer = () => { | ||
// handles styles | ||
const { styles } = useStylesContext(); | ||
|
||
// handles toasts | ||
const { toasts } = useToastsContext(); | ||
|
||
// styles for toast prompt container | ||
const toastPromptContainerStyle: CSSProperties = { | ||
bottom: (styles.footerStyle?.height as number ?? 50) + | ||
(styles.chatInputContainerStyle?.height as number ?? 70) + 20, | ||
width: 300, | ||
minWidth: (styles.chatWindowStyle?.width as number ?? 375) / 2, | ||
maxWidth: (styles.chatWindowStyle?.width as number ?? 375) - 50, | ||
...styles.toastPromptContainerStyle | ||
}; | ||
|
||
return ( | ||
<div className="rcb-toast-prompt-container" style={toastPromptContainerStyle}> | ||
{toasts.map((toast) => ( | ||
<ToastPrompt | ||
key={toast.id} | ||
id={toast.id} | ||
content={toast.content} | ||
timeout={toast.timeout} | ||
/> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ToastContainer; |
File renamed without changes.
File renamed without changes.