-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
Copy pathsuccess.tsx
53 lines (48 loc) · 1.77 KB
/
success.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from "react";
import { useCustomAuth } from "./hooks/useCustomAuth"; // Assuming this hook is in this path
export const SuccessPage = () => {
const { user } = useCustomAuth();
if (!user) {
return <div className="loading">Loading user data...</div>;
}
return (
<div className="success-container">
<h2>Sign In Successful!</h2>
<p>Welcome, {user.displayName || user.username}!</p>
<div className="user-profile">
<h3>User Profile</h3>
{user.profileImage && (
<div className="profile-image">
<img src={user.profileImage} alt="Profile" />
</div>
)}
<div className="user-details">
<p>
<strong>Username:</strong> {user.username}
</p>
{user.email && (
<p>
<strong>Email:</strong> {user.email}
</p>
)}
{user.fullName && (
<p>
<strong>Full Name:</strong> {user.fullName}
</p>
)}
{user.accountType && (
<p>
<strong>Account Type:</strong> {user.accountType}
</p>
)}
{user.memberSince && (
<p>
<strong>Member Since:</strong>{" "}
{new Date(user.memberSince).toLocaleDateString()}
</p>
)}
</div>
</div>
</div>
);
};