@@ -5,83 +5,95 @@ import { useEffect, useState } from "react";
5
5
//React Hook used for defining routes to pages
6
6
import { Routes , Route , useNavigate } from "react-router" ;
7
7
//context
8
- import { FormProvider } from "./Components/FormContext" ;
8
+ import { FormProvider } from "./Components/Globals/ FormContext" ;
9
9
//logo import
10
10
import tranquilLogo from "./Assets/home_logo.svg" ;
11
11
//importing pages/components
12
- import Login from "./Components/Login Page/Login" ;
13
- import Slides from "./Components/SignUp Page/Slides/Slides" ;
14
- import SignUp from "./Components/SignUp Page/SignUp" ;
15
- import Otp from "./Components/SignUp Page/OTP/Otp" ;
16
- import SignIn from "./Components/Login Page/SignIn/SignIn" ;
17
- import Forgot from "./Components/ForgotPassword/Forgot" ;
18
- import Redirector from "./Components/redirector" ;
19
- import Tranquil from "./Components/Tranquil App/Tranquil" ;
20
- import Profile from "./Components/Tranquil App/Profile/Profile" ;
12
+ import Login from "./Components/Forms/Login/Login" ;
13
+ import SignIn from "./Components/Forms/SignIn/SignIn" ;
14
+ import SignUp from "./Components/Forms/SignUp/SignUp" ;
15
+ import Slides from "./Components/Forms/Slides/Slides" ;
16
+ import Prompts from "./Components/Forms/NewUserPrompt/Prompt" ;
17
+ import Redirector from "./Components/Forms/Redirect/Redirector" ;
18
+ import Otp from "./Components/Forms/OTP/Otp" ;
19
+ import Forgot from "./Components/Forms/ForgotPassword/Forgot" ;
20
+ import Tranquil from "./Components/Tranquil App/Tranquil/Tranquil" ;
21
+ import Profile from "./Components/Tranquil App/Profile/Profile/Profile" ;
21
22
import EditProfile from "./Components/Tranquil App/Profile/Profile_Update/UpdateProfile" ;
22
- import Intro from "./Components/Introduction/Intro" ;
23
-
23
+ import { PageProvider } from "./Components/Tranquil App/Tranquil/PageContext" ;
24
24
function App ( ) {
25
- var navigate = useNavigate ( ) ;
26
- var [ openingCompleted , setCompletionState ] = useState ( false ) ;
27
- var [ firstTextDisplay , setNewTextDisplay ] = useState ( true ) ;
28
- function Opening ( ) {
29
- useEffect ( ( ) => {
30
- const firstTextTimer = setTimeout ( ( ) => {
31
- setNewTextDisplay ( false ) ;
32
- } , 2000 ) ;
25
+ var navigate = useNavigate ( ) ;
26
+ var [ openingCompleted , setCompletionState ] = useState ( false ) ;
27
+ var [ firstTextDisplay , setNewTextDisplay ] = useState ( true ) ;
28
+ function Opening ( ) {
29
+ useEffect ( ( ) => {
30
+ const firstTextTimer = setTimeout ( ( ) => {
31
+ setNewTextDisplay ( false ) ;
32
+ } , 2000 ) ;
33
33
34
- const introTimer = setTimeout ( ( ) => {
35
- setCompletionState ( true ) ;
36
- } , 2100 ) ;
34
+ const introTimer = setTimeout ( ( ) => {
35
+ setCompletionState ( true ) ;
36
+ } , 2100 ) ;
37
37
38
- return ( ) => {
39
- clearTimeout ( firstTextTimer ) ;
40
- clearTimeout ( introTimer ) ;
41
- } ;
42
- } , [ ] ) ;
43
- useEffect ( ( ) => {
44
- openingCompleted === true && navigate ( "/login" ) ;
45
- } ) ;
38
+ return ( ) => {
39
+ clearTimeout ( firstTextTimer ) ;
40
+ clearTimeout ( introTimer ) ;
41
+ } ;
42
+ } , [ ] ) ;
43
+ useEffect ( ( ) => {
44
+ openingCompleted === true && navigate ( "/login" ) ;
45
+ } ) ;
46
46
47
- return (
48
- < div className = "Opening" >
49
- < header >
50
- < div className = "imgText" >
51
- < div className = "logo" >
52
- < img src = { tranquilLogo } alt = "" />
47
+ return (
48
+ < div className = "Opening" >
49
+ < header >
50
+ < div className = "imgText" >
51
+ < div className = "logo" >
52
+ < img src = { tranquilLogo } alt = "" />
53
+ </ div >
54
+
55
+ { firstTextDisplay ? (
56
+ < p className = "firstText" >
57
+ Unleash the Power within
58
+ </ p >
59
+ ) : (
60
+ < p className = "secondText" >
61
+ Find your inner Balance
62
+ </ p >
63
+ ) }
64
+ </ div >
65
+ </ header >
53
66
</ div >
67
+ ) ;
68
+ }
54
69
55
- { firstTextDisplay ? (
56
- < p className = "firstText" > Unleash the Power within</ p >
57
- ) : (
58
- < p className = "secondText" > Find your inner Balance</ p >
59
- ) }
60
- </ div >
61
- </ header >
62
- </ div >
70
+ return (
71
+ < FormProvider >
72
+ < PageProvider >
73
+ < Routes >
74
+ < Route index element = { < Opening /> } />
75
+ < Route path = "/login" element = { < Login /> } />
76
+ < Route path = "/signIn" element = { < SignIn /> } />
77
+ < Route path = "/signUp" element = { < SignUp /> } />
78
+ < Route path = "/getStarted" element = { < Slides /> } />
79
+ < Route path = "/newUser" element = { < Prompts /> } />
80
+ < Route
81
+ path = "/redirectPage/:token"
82
+ element = { < Redirector /> }
83
+ />
84
+ < Route path = "/otp" element = { < Otp /> } />
85
+ < Route path = "/forgotPassword" element = { < Forgot /> } />
86
+ < Route path = "/tranquil/*" element = { < Tranquil /> } />
87
+ < Route path = "/tranquil/profile/" element = { < Profile /> } />
88
+ < Route
89
+ path = "/tranquil/profile/editProfile"
90
+ element = { < EditProfile /> }
91
+ />
92
+ </ Routes >
93
+ </ PageProvider >
94
+ </ FormProvider >
95
+ //These are the routes to various pages of the app
63
96
) ;
64
- }
65
-
66
- return (
67
- < FormProvider >
68
- < Routes >
69
- < Route index element = { < Opening /> } />
70
- < Route path = "/login" element = { < Login /> } />
71
- < Route path = "/signIn" element = { < SignIn /> } />
72
- < Route path = "/signIn/forgotPassword" element = { < Forgot /> } />
73
- < Route path = "/signUp" element = { < SignUp /> } />
74
- < Route path = "/getStarted" element = { < Slides /> } />
75
- < Route path = "/otp" element = { < Otp /> } />
76
- < Route path = "/redirectPage/:token" element = { < Redirector /> } />
77
- < Route path = "/tranquil/*" element = { < Tranquil /> } />
78
- < Route path = "/tranquil/profile/" element = { < Profile /> } />
79
- < Route path = "/tranquil/profile/editProfile" element = { < EditProfile /> } />
80
- < Route path = "/intro" element = { < Intro /> } />
81
- </ Routes >
82
- </ FormProvider >
83
- //These are the routes to various pages of the app
84
- ) ;
85
97
}
86
98
87
99
export default App ;
0 commit comments