Skip to content

Commit

Permalink
fix: remove liens evitement mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurlbrjc committed Oct 23, 2024
1 parent 71866d1 commit 345b2c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/(connected)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export default async function LayoutWhenConnected({

return (
<>
<LiensEvitement />

<AppContextProviders conseiller={conseiller} portefeuille={portefeuille}>
<LiensEvitement />

{children}
</AppContextProviders>

Expand Down
5 changes: 5 additions & 0 deletions components/LiensEvitement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import { usePathname } from 'next/navigation'
import React, { useEffect, useRef, useState } from 'react'

import { ID_CHAT, ID_CONTENU, ID_MENU } from 'components/globals'
import { useMobileViewport } from 'utils/mobileViewportContext'

export default function LiensEvitement() {
const pathname = usePathname()
const refContainer = useRef<HTMLDivElement>(null)

const isMobileViewport = useMobileViewport()

const [pageTitle, setPageTitle] = useState<string>()
const [pageHasChatAside, setPageHasChatAside] = useState<boolean>(false)

Expand All @@ -26,6 +29,8 @@ export default function LiensEvitement() {
setPageHasChatAside(Boolean(document.getElementById(ID_CHAT)))
}, [pageTitle])

if (isMobileViewport) return null

return (
<>
<div ref={refContainer} tabIndex={-1} className='sr-only'>
Expand Down

0 comments on commit 345b2c3

Please sign in to comment.