Skip to content

Commit 20177fd

Browse files
author
Bogdan Tsechoev
committedNov 13, 2024·
Merge branch 'fix_mobile_input' into 'master'
fix: Input field visibility on AI assistant page on mobile Closes #576 See merge request postgres-ai/database-lab!931
2 parents c4144cd + ecb7ae4 commit 20177fd

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed
 

‎ui/packages/platform/src/components/ContentLayout/index.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import React from 'react'
10-
import { useRouteMatch } from 'react-router-dom'
10+
import { useLocation, useRouteMatch } from 'react-router-dom'
1111
import clsx from 'clsx'
1212
import { observer } from 'mobx-react-lite'
1313

@@ -20,6 +20,7 @@ import { DeprecatedApiBanner } from './DeprecatedApiBanner'
2020
import { Footer } from './Footer'
2121

2222
import styles from './styles.module.scss'
23+
import cn from "classnames";
2324

2425
type Props = {
2526
children: React.ReactNode
@@ -28,6 +29,8 @@ type Props = {
2829
export const ContentLayout = React.memo(observer((props: Props) => {
2930
const { children } = props
3031

32+
const location = useLocation();
33+
3134
const isOrgJoeInstance = Boolean(
3235
useRouteMatch(ROUTES.ORG.JOE_INSTANCES.JOE_INSTANCE.createPath()),
3336
)
@@ -36,12 +39,16 @@ export const ContentLayout = React.memo(observer((props: Props) => {
3639
useRouteMatch(ROUTES.ORG.PROJECT.JOE_INSTANCES.JOE_INSTANCE.createPath()),
3740
)
3841

42+
const isAssistantPage = Boolean(
43+
useRouteMatch(ROUTES.ORG.PROJECT.ASSISTANT.createPath())
44+
)
45+
3946
const isDemoOrg = Boolean(useRouteMatch(`/${settings.demoOrgAlias}`))
4047

4148
const isHiddenFooter = isOrgJoeInstance || isProjectJoeInstance
4249

4350
return (
44-
<div className={styles.root}>
51+
<div className={cn(styles.root, {[styles.rootAssistant]: isAssistantPage})}>
4552
{isDemoOrg && <DemoOrgNotice />}
4653
{ bannersStore.isOpenDeprecatedApi && <DeprecatedApiBanner /> }
4754

‎ui/packages/platform/src/components/ContentLayout/styles.module.scss

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
min-width: 0;
1818
}
1919

20+
.rootAssistant {
21+
@media (max-width: 480px) {
22+
height: 100dvh;
23+
}
24+
}
25+
2026
.wrapper {
2127
flex: 1 1 100%;
2228
overflow: auto;

‎ui/packages/platform/src/config/routes/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ export const ROUTES = {
5353
},
5454

5555
INSTANCES: PROJECT_INSTANCES,
56+
57+
ASSISTANT: {
58+
createPath: ({
59+
org = ':org',
60+
id,
61+
}: { org?: string; id?: string } = {}) =>
62+
id ? `/${org}/assistant/${id}` : `/${org}/assistant`,
63+
}
5664
},
5765
},
5866
}

0 commit comments

Comments
 (0)
Please sign in to comment.