Skip to content

Commit

Permalink
[FIX] Make height and width data options apply to mobile styles (#1412)
Browse files Browse the repository at this point in the history
* make height and width data options apply to mobile styles

* update build and respect viewport on dev index

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
  • Loading branch information
shatfield4 and timothycarambat committed May 16, 2024
1 parent 15cf921 commit a796830
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions embed/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<!doctype html>

<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<html lang="en">

<body>
Expand Down
10 changes: 5 additions & 5 deletions embed/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ export default function App() {

const position = embedSettings.position || "bottom-right";
const windowWidth = embedSettings.windowWidth
? `md:max-w-[${embedSettings.windowWidth}]`
: "md:max-w-[400px]";
? `max-w-[${embedSettings.windowWidth}]`
: "max-w-[400px]";
const windowHeight = embedSettings.windowHeight
? `md:max-h-[${embedSettings.windowHeight}]`
: "md:max-h-[700px]";
? `max-h-[${embedSettings.windowHeight}]`
: "max-h-[700px]";

return (
<>
<Head />
<div className={`fixed inset-0 z-50 ${isChatOpen ? "block" : "hidden"}`}>
<div
className={`${windowHeight} ${windowWidth} h-full w-full bg-white md:fixed md:bottom-0 md:right-0 md:mb-4 md:mr-4 md:rounded-2xl md:border md:border-gray-300 md:shadow-[0_4px_14px_rgba(0,0,0,0.25)] ${positionClasses[position]}`}
className={`${windowHeight} ${windowWidth} h-full w-full bg-white fixed bottom-0 right-0 mb-4 md:mr-4 rounded-2xl border border-gray-300 shadow-[0_4px_14px_rgba(0,0,0,0.25)] ${positionClasses[position]}`}
id="anything-llm-chat"
>
{isChatOpen && (
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/embed/anythingllm-chat-widget.min.js

Large diffs are not rendered by default.

0 comments on commit a796830

Please sign in to comment.