55 *--------------------------------------------------------------------------
66 */
77
8- import { makeStyles } from '@material-ui/core'
8+ import { makeStyles , useMediaQuery } from '@material-ui/core'
99import { GatewayLink } from '@postgres.ai/shared/components/GatewayLink'
10+ import { useMemo } from 'react'
11+ import { useLocation } from 'react-router-dom'
1012
1113import settings from 'utils/settings'
14+ import cn from "classnames" ;
1215
1316const 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
6773export const Footer = ( ) => {
6874 const classes = useStyles ( )
75+ const location = useLocation ( ) ;
76+ const isMobile = useMediaQuery ( '(max-width:480px)' ) ;
77+
78+ const isAssistantPage = useMemo ( ( ) => {
79+ return / ^ \/ [ ^ \/ ] + \/ a s s i s t a n t ( \/ [ ^ \/ ] + ) ? \/ ? $ / . 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