Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
add prelim styles for chat popup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayla Fitzsimmons authored and Kayla Fitzsimmons committed Sep 4, 2024
1 parent 66854a0 commit 201c6e8
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions apps/mocksi-lite-next/src/pages/content/mocksi-extension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@ function getIframeStyles(message: string): Partial<CSSStyleDeclaration> {
inset: "0px 10px auto auto",
width: "400px",
};

case "CHAT":
return {
bottom: "0px",
display: "block",
height: "500px",
left: "calc(50%-150px)",
right: "auto",
top: "auto",
width: "300px",
};
case "DEMO_ACTIVE":
return {
display: "block",
Expand Down Expand Up @@ -115,13 +124,6 @@ chrome.runtime.onMessage.addListener((request) => {
(async () => {
let data = null;

if (request.message === "CHAT") {
sendResponse({
data: reactor.exportDOM(),
message: request.message,
status: "ok",
});
}
if (request.message === "CHAT_NEW_MESSAGE") {
sendResponse({
message: request.message,
Expand Down Expand Up @@ -157,6 +159,14 @@ chrome.runtime.onMessage.addListener((request) => {
Object.assign(iframeRef.current.style, styles);
}

if (request.message === "CHAT") {
sendResponse({
data: reactor.exportDOM(),
message: request.message,
status: "ok",
});
}

sendResponse({
data,
message: request.message,
Expand Down

0 comments on commit 201c6e8

Please sign in to comment.