Franknoirot/online indicator (#443)

* Add network health indicator to AppHeader

* Add tests for network detection responsiveness

* Format test file
This commit is contained in:
Frank Noirot
2023-09-12 14:58:59 -04:00
committed by GitHub
parent 8071eb6f8a
commit ee767afc3f
3 changed files with 166 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import { ProjectWithEntryPointMetadata } from '../Router'
import ProjectSidebarMenu from './ProjectSidebarMenu'
import { useGlobalStateContext } from 'hooks/useGlobalStateContext'
import styles from './AppHeader.module.css'
import { NetworkHealthIndicator } from './NetworkHealthIndicator'
interface AppHeaderProps extends React.PropsWithChildren {
showToolbar?: boolean
@ -43,7 +44,8 @@ export const AppHeader = ({
)}
{/* If there are children, show them, otherwise show User menu */}
{children || (
<div className="ml-auto">
<div className="ml-auto flex items-center gap-1">
<NetworkHealthIndicator />
<UserSidebarMenu user={user} />
</div>
)}