Skip to content

Commit

Permalink
⏪️ Revert experiment #805
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandolucchesi committed Jan 30, 2023
1 parent 303025c commit 545933f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions web/lib/contexts/PreviewContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createContext, useEffect, useState } from 'react'
import { createContext, useState } from 'react'

type Props = {
isPreview: boolean
Expand All @@ -19,12 +19,5 @@ export const PreviewContext = createContext<Props>({
export const PreviewContextProvider = ({ children }: ProviderProps) => {
const [isPreview, setIsPreview] = useState(false)

useEffect(() => {
if (isPreview) {
const cookiebot = document.getElementById('Cookiebot')
cookiebot?.remove()
}
}, [isPreview])

return <PreviewContext.Provider value={{ isPreview, setIsPreview }}>{children}</PreviewContext.Provider>
}

0 comments on commit 545933f

Please sign in to comment.