@@ -2,19 +2,79 @@ import { useRequireAuth } from '@lib/hooks/useRequireAuth';
2
2
import { Aside } from '@components/aside/aside' ;
3
3
import { Suggestions } from '@components/aside/suggestions' ;
4
4
import { 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' ;
6
9
7
10
export type LayoutProps = {
8
11
children : ReactNode ;
9
12
} ;
10
13
11
14
export 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 ( ) ;
14
17
18
+ const [ disclaimerAccepted , setDisclaimerAccepted ] = useState ( false ) ;
15
19
if ( ! user ) return < Placeholder /> ;
16
20
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
+ ) ;
18
78
}
19
79
20
80
export function HomeLayout ( { children } : LayoutProps ) : JSX . Element {
0 commit comments