mirror of
https://github.com/randyjc/Rahoot.git
synced 2026-03-13 20:15:35 +01:00
refactor: add typescript & pnpm workspace & docker file
This commit is contained in:
17
packages/web/src/app/(auth)/layout.tsx
Normal file
17
packages/web/src/app/(auth)/layout.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
"use client"
|
||||
|
||||
import { useSocket } from "@rahoot/web/contexts/socketProvider"
|
||||
import { PropsWithChildren, useEffect } from "react"
|
||||
|
||||
const AuthLayout = ({ children }: PropsWithChildren) => {
|
||||
const { isConnected, connect } = useSocket()
|
||||
useEffect(() => {
|
||||
if (!isConnected) {
|
||||
connect()
|
||||
}
|
||||
}, [connect, isConnected])
|
||||
|
||||
return children
|
||||
}
|
||||
|
||||
export default AuthLayout
|
||||
Reference in New Issue
Block a user