Skip to content

Commit

Permalink
bugfix: follow up inline questions have ratings below the fold
Browse files Browse the repository at this point in the history
  • Loading branch information
skeptrunedev authored and densumesh committed Jan 14, 2025
1 parent 4fb4310 commit 74eebae
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions clients/search-component/src/TrieveModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const Modal = () => {
chatOuterWrapper = document.querySelector(".chat-outer-wrapper");
} else {
chatOuterWrapper = document.querySelector(
".chat-outer-wrapper.chat-outer-popup",
".chat-outer-wrapper.chat-outer-popup"
);
}

Expand All @@ -62,7 +62,12 @@ const Modal = () => {

if (chatOuterWrapper && props.type && viewportHeight) {
const newHeight =
viewportHeight - (props.type == "ecommerce" ? 150 : 175);
viewportHeight -
(props.type == "ecommerce"
? props.groupTrackingId
? 225
: 150
: 175);
(chatOuterWrapper as HTMLElement).style.maxHeight = `${newHeight}px`;
}
} else if (chatOuterWrapper) {
Expand Down Expand Up @@ -101,7 +106,7 @@ const Modal = () => {
clearConversation();
chatWithGroup(
customEvent.detail.group,
customEvent.detail.betterGroupName,
customEvent.detail.betterGroupName
);
if (customEvent.detail.message) {
askQuestion(customEvent.detail.message, customEvent.detail.group);
Expand Down Expand Up @@ -147,14 +152,14 @@ const Modal = () => {

window.addEventListener(
"trieve-start-chat-with-group",
chatWithGroupListener,
chatWithGroupListener
);
window.addEventListener("trieve-open-with-text", openWithTextListener);

return () => {
window.removeEventListener(
"trieve-start-chat-with-group",
chatWithGroupListener,
chatWithGroupListener
);

window.removeEventListener("trieve-open-with-text", openWithTextListener);
Expand All @@ -164,26 +169,26 @@ const Modal = () => {
useEffect(() => {
document.documentElement.style.setProperty(
"--tv-prop-brand-color",
props.brandColor ?? "#CB53EB",
props.brandColor ?? "#CB53EB"
);

if (props.theme === "dark") {
document.documentElement.style.setProperty(
"--tv-prop-scrollbar-thumb-color",
"var(--tv-zinc-700)",
"var(--tv-zinc-700)"
);
} else {
document.documentElement.style.setProperty(
"--tv-prop-scrollbar-thumb-color",
"var(--tv-zinc-300)",
"var(--tv-zinc-300)"
);
}

document.documentElement.style.setProperty(
"--tv-prop-brand-font-family",
props.brandFontFamily ??
`Maven Pro, ui-sans-serif, system-ui, sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`
);
}, [props.brandColor, props.brandFontFamily]);

Expand Down

0 comments on commit 74eebae

Please sign in to comment.