Oayout
This commit is contained in:
parent
89eadbd477
commit
abe584b1c1
@ -45,7 +45,7 @@ export default function RootLayout({
|
|||||||
{!hasEnvVars ? <EnvVarWarning /> : <HeaderAuth />}
|
{!hasEnvVars ? <EnvVarWarning /> : <HeaderAuth />}
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<div className="flex flex-col gap-20 max-w-5xl p-5">
|
<div className="flex flex-col gap-20 w-[40%] p-5">
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
14
nazara/apps/web/lib/realtime.tsx
Normal file
14
nazara/apps/web/lib/realtime.tsx
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
export default function
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const daysChannel = supabase.channel('days')
|
||||||
|
.on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'days' }, (payload) => {
|
||||||
|
setDay(payload.new);
|
||||||
|
}).subscribe();
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
daysChannel.unsubscribe();
|
||||||
|
}
|
||||||
|
}, [supabase])
|
||||||
Loading…
Reference in New Issue
Block a user