Skip to content

Commit 52076fa

Browse files
author
Bogdan Tsechoev
committed
Assistant: Hide footer on assistant page for mobile devices
1 parent a65008c commit 52076fa

File tree

1 file changed

+14
-2
lines changed
  • ui/packages/platform/src/components/ContentLayout/Footer

1 file changed

+14
-2
lines changed

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
*--------------------------------------------------------------------------
66
*/
77

8-
import { makeStyles } from '@material-ui/core'
8+
import { makeStyles, useMediaQuery } from '@material-ui/core'
99
import { GatewayLink } from '@postgres.ai/shared/components/GatewayLink'
10+
import { useMemo } from 'react'
11+
import { useLocation } from 'react-router-dom'
1012

1113
import settings from 'utils/settings'
14+
import cn from "classnames";
1215

1316
const useStyles = makeStyles(
1417
(theme) => ({
@@ -24,6 +27,9 @@ const useStyles = makeStyles(
2427
flexDirection: 'column',
2528
},
2629
},
30+
hidden: {
31+
display: 'none'
32+
},
2733
footerCopyrightItem: {
2834
marginRight: 50,
2935
[theme.breakpoints.down('sm')]: {
@@ -66,9 +72,15 @@ const useStyles = makeStyles(
6672

6773
export const Footer = () => {
6874
const classes = useStyles()
75+
const location = useLocation();
76+
const isMobile = useMediaQuery('(max-width:480px)');
77+
78+
const isAssistantPage = useMemo(() => {
79+
return /^\/[^\/]+\/assistant(\/[^\/]+)?\/?$/.test(location.pathname);
80+
}, [location.pathname]);
6981

7082
return (
71-
<footer className={classes.footer}>
83+
<footer className={cn(classes.footer, {[classes.hidden]: isAssistantPage && isMobile})}>
7284
<div className={classes.footerCopyrightItem}>
7385
{new Date().getFullYear()} © Postgres.AI
7486
</div>

0 commit comments

Comments
 (0)