Skip to content

Commit

Permalink
fix: fixed height based on the user agent for fullchat and zoomed ful…
Browse files Browse the repository at this point in the history
…l body layouts
  • Loading branch information
andrepat0 committed Nov 15, 2024
1 parent 0fe2239 commit 81d53a9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
12 changes: 8 additions & 4 deletions src/components/layouts/FullPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ const FullPageLayout: React.FC<LayoutProps> = ({
showInstruct = false,
loading = false,
poweredBy,
}) => (
<>
}) => {
const isChrome = navigator.userAgent.includes('Chrome');

return (
<>
{integrationStyle}
{integrationBackground}

<Spin className="memori-full-body--container" spinning={loading}>
<Spin className={`memori-full-body--container ${isChrome ? 'memori-full-body--container--chrome' : 'memori-full-body--container--safari'}`} spinning={loading}>
{showInstruct && ChangeMode && changeModeProps && (
<ChangeMode {...changeModeProps} />
)}
Expand All @@ -52,6 +55,7 @@ const FullPageLayout: React.FC<LayoutProps> = ({
</div>
</Spin>
</>
);
);
};

export default FullPageLayout;
4 changes: 3 additions & 1 deletion src/components/layouts/ZoomedFullBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ const ZoomedFullBodyLayout: React.FC<LayoutProps> = ({
};
}, []); // Empty dependency array since we only want this to run once on mount

const isChrome = navigator.userAgent.includes('Chrome');

return (
<>
{integrationStyle}
{integrationBackground}

<Spin className="memori-full-body--container" spinning={loading}>
<Spin className={`memori-full-body--container ${isChrome ? 'memori-full-body--container--chrome' : 'memori-full-body--container--safari'}`} spinning={loading}>
{showInstruct && ChangeMode && changeModeProps && (
<ChangeMode {...changeModeProps} />
)}
Expand Down
17 changes: 13 additions & 4 deletions src/components/layouts/zoomed-full-body.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,25 @@
scroll-behavior: smooth;
}

.memori-chat--history {
max-height: calc(100% - 180px);
}

/* Mobile styles */
@media (max-width: 870px) {
/* Layout */
.memori-full-body--container {
display: flex;
height: 85vh !important;
flex-direction: column;
overscroll-behavior-y: none;
}

.memori-full-body--container--chrome{
height: 90vh !important;
}

.memori-full-body--container--safari{
height: 85vh !important;
}


.memori--powered-by-custom {
top: 30px;
bottom: auto;
Expand Down Expand Up @@ -224,6 +229,10 @@
height: calc(100% - 1rem);
}

.memori--grid-column-right{
overflow-y: auto;
}

.memori-full-body-layout--controls .memori-chat--bubble,
.memori-full-body-layout--controls .memori-chat--bubble.memori-chat--user-bubble {
position: relative;
Expand Down

0 comments on commit 81d53a9

Please sign in to comment.