1
1
import { StrictMode } from "react" ;
2
2
import { createRoot } from "react-dom/client" ;
3
3
import { initializeUI } from "@firebase-ui/core" ;
4
- import { CustomSignInScreen } from "./auth/custom-sign-in-screen" ;
5
4
import { useAuth } from "~/hooks" ;
6
5
import { onAuthStateChanged , signOut } from "firebase/auth" ;
7
6
import { useState , useEffect } from "react" ;
@@ -17,6 +16,8 @@ import Example1 from "./examples/example_1";
17
16
import Example2 from "./examples/example_2" ;
18
17
import Example3 from "./examples/example_3" ;
19
18
import { CardHeader } from "./components/card-header" ;
19
+ import { Card } from "./components/card" ;
20
+ import { CustomSignInScreen } from "./auth/custom-sign-in-screen" ;
20
21
21
22
import "./styles.css" ;
22
23
import { connectAuthEmulator , getAuth } from "firebase/auth" ;
@@ -114,55 +115,71 @@ function App() {
114
115
if ( path === "/signin" ) {
115
116
return (
116
117
< CustomSignInScreen >
117
- < CardHeader titleKey = "signIn" subtitleKey = "signInToAccount" />
118
- < EmailPasswordForm
119
- onForgotPasswordClick = { ( ) => navigate ( "/forgot-password" ) }
120
- onRegisterClick = { ( ) => navigate ( "/register" ) }
121
- />
122
- < Divider text = "or" />
123
- < GoogleForm />
118
+ < Card >
119
+ < CardHeader titleKey = "signIn" subtitleKey = "signInToAccount" />
120
+ < EmailPasswordForm
121
+ onForgotPasswordClick = { ( ) => navigate ( "/forgot-password" ) }
122
+ onRegisterClick = { ( ) => navigate ( "/register" ) }
123
+ />
124
+ < Divider text = "or" />
125
+ < GoogleForm />
126
+ </ Card >
124
127
</ CustomSignInScreen >
125
128
) ;
126
129
}
127
130
128
131
if ( path === "/forgot-password" ) {
129
132
return (
130
133
< CustomSignInScreen >
131
- < CardHeader titleKey = "resetPassword" subtitleKey = "enterEmailToReset" />
132
- < ForgotPasswordForm />
134
+ < Card >
135
+ < CardHeader
136
+ titleKey = "resetPassword"
137
+ subtitleKey = "enterEmailToReset"
138
+ />
139
+ < ForgotPasswordForm />
140
+ </ Card >
133
141
</ CustomSignInScreen >
134
142
) ;
135
143
}
136
144
137
145
if ( path === "/register" ) {
138
146
return (
139
147
< CustomSignInScreen >
140
- < CardHeader
141
- titleKey = "createAccount"
142
- subtitleKey = "enterDetailsToCreate"
143
- />
144
- < RegisterForm onBackToSignInClick = { ( ) => navigate ( "/signin" ) } />
148
+ < Card >
149
+ < CardHeader
150
+ titleKey = "createAccount"
151
+ subtitleKey = "enterDetailsToCreate"
152
+ />
153
+ < RegisterForm onBackToSignInClick = { ( ) => navigate ( "/signin" ) } />
154
+ </ Card >
145
155
</ CustomSignInScreen >
146
156
) ;
147
157
}
148
158
149
159
if ( path === "/phone" ) {
150
160
return (
151
161
< CustomSignInScreen >
152
- < CardHeader titleKey = "signInWithPhone" subtitleKey = "enterPhoneNumber" />
153
- < PhoneForm />
162
+ < Card >
163
+ < CardHeader
164
+ titleKey = "signInWithPhone"
165
+ subtitleKey = "enterPhoneNumber"
166
+ />
167
+ < PhoneForm />
168
+ </ Card >
154
169
</ CustomSignInScreen >
155
170
) ;
156
171
}
157
172
158
173
if ( path === "/email-link" ) {
159
174
return (
160
175
< CustomSignInScreen >
161
- < CardHeader
162
- titleKey = "signInWithEmailLink"
163
- subtitleKey = "enterEmailForLink"
164
- />
165
- < EmailLinkForm />
176
+ < Card >
177
+ < CardHeader
178
+ titleKey = "signInWithEmailLink"
179
+ subtitleKey = "enterEmailForLink"
180
+ />
181
+ < EmailLinkForm />
182
+ </ Card >
166
183
</ CustomSignInScreen >
167
184
) ;
168
185
}
@@ -176,12 +193,14 @@ function App() {
176
193
You are signed in anonymously
177
194
</ div >
178
195
< CustomSignInScreen >
179
- < CardHeader titleKey = "signIn" subtitleKey = "signInToAccount" />
180
- < EmailPasswordForm
181
- onForgotPasswordClick = { ( ) => navigate ( "/forgot-password" ) }
182
- onRegisterClick = { ( ) => navigate ( "/register" ) }
183
- />
184
- < GoogleForm />
196
+ < Card >
197
+ < CardHeader titleKey = "signIn" subtitleKey = "signInToAccount" />
198
+ < EmailPasswordForm
199
+ onForgotPasswordClick = { ( ) => navigate ( "/forgot-password" ) }
200
+ onRegisterClick = { ( ) => navigate ( "/register" ) }
201
+ />
202
+ < GoogleForm />
203
+ </ Card >
185
204
</ CustomSignInScreen >
186
205
</ div >
187
206
) ;
0 commit comments