@@ -2,19 +2,79 @@ import { useRequireAuth } from '@lib/hooks/useRequireAuth';
22import { Aside } from '@components/aside/aside' ;
33import { Suggestions } from '@components/aside/suggestions' ;
44import { Placeholder } from '@components/common/placeholder' ;
5- import type { ReactNode } from 'react' ;
5+ import { type ReactNode , useState } from 'react' ;
6+ import { Modal } from '@components/modal/modal' ;
7+ import { Button } from '@components/ui/button' ;
8+ import { useAuth } from '@lib/context/auth-context' ;
69
710export type LayoutProps = {
811 children : ReactNode ;
912} ;
1013
1114export function ProtectedLayout ( { children } : LayoutProps ) : JSX . Element {
12- // const user = useRequireAuth();
13- const user = true ; // TODO: Change back to useRequireAuth; Doing for development purposes
15+ const user = useRequireAuth ( ) ;
16+ const { signOut } = useAuth ( ) ;
1417
18+ const [ disclaimerAccepted , setDisclaimerAccepted ] = useState ( false ) ;
1519 if ( ! user ) return < Placeholder /> ;
1620
17- return < > { children } </ > ;
21+ return (
22+ < >
23+ { children }
24+ { ! disclaimerAccepted ? (
25+ < Modal
26+ open = { ! disclaimerAccepted }
27+ closeModal = { ( ) => signOut ( ) }
28+ className = 'max-w-lg mx-auto mt-24'
29+ modalClassName = 'bg-black backdrop-blur-md p-6 rounded-lg flex flex-col gap-2'
30+ >
31+ < h1 className = 'text-xl text-center font-bold' >
32+ Disclaimer from MetaState Foundation
33+ </ h1 >
34+ < p className = 'font-bold' > ⚠️ Please note:</ p >
35+ < p >
36+ Blabsy is a < b > functional prototype</ b > , intended to
37+ showcase < b > interoperability</ b > and core concepts of
38+ the W3DS ecosystem.
39+ </ p >
40+ < p >
41+ < b > It is not a production-grade platform</ b > and may
42+ lack full reliability, performance, and security
43+ guarantees.
44+ </ p >
45+ < p >
46+ We < b > strongly recommend</ b > that you avoid sharing{ ' ' }
47+ < b > sensitive or private content</ b > , and kindly ask for
48+ your understanding regarding any bugs, incomplete
49+ features, or unexpected behaviours.
50+ </ p >
51+ < p >
52+ The app is still in development, so we kindly ask for
53+ your understanding regarding any potential issues. If
54+ you experience issues or have feedback, feel free to
55+ contact us at:
56+ </ p >
57+ < a
58+ 59+ className = 'outline-none'
60+ >
61+ 62+ </ a >
63+ < Button
64+ type = 'button'
65+ className = 'mt-4 bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600'
66+ onClick = { ( ) => {
67+ setDisclaimerAccepted ( true ) ;
68+ } }
69+ >
70+ I Understand
71+ </ Button >
72+ </ Modal >
73+ ) : (
74+ < > </ >
75+ ) }
76+ </ >
77+ ) ;
1878}
1979
2080export function HomeLayout ( { children } : LayoutProps ) : JSX . Element {
0 commit comments