diff --git a/src/components/Login/account-dropdown.tsx b/src/components/Login/account-dropdown.tsx index 5e5cb2fb7..30b1889a5 100644 --- a/src/components/Login/account-dropdown.tsx +++ b/src/components/Login/account-dropdown.tsx @@ -6,7 +6,7 @@ export default function AccountDropdown() { const [isOpen, setIsOpen] = useState(false); useEffect(() => { - // If dropdown is open, close it. + // If user click outside the dropdown, and dropdown is open then close it. const handleOpen = () => { if (isOpen) setIsOpen(false); }; diff --git a/src/components/Profile/profile-details.tsx b/src/components/Profile/profile-details.tsx new file mode 100644 index 000000000..06a48ebb6 --- /dev/null +++ b/src/components/Profile/profile-details.tsx @@ -0,0 +1,45 @@ +import { useAuth } from '../../hooks/use-auth'; + +export default function ProfileDetails() { + const { user, isLoading } = useAuth(); + return ( +
+

Profile

+

Here you can view your profile details.

+
+
+ +
+ {isLoading || !user ? ( + + ) : ( +

+ {user?.name} +

+ )} +
+
+
+ +
+ {isLoading || !user ? ( + + ) : ( +

+ {user?.email} +

+ )} +
+
+
+
+ ); +} + +function Skeleton({ className }: { className?: string }) { + return ( +
+ ); +} diff --git a/src/pages/profile/index.astro b/src/pages/profile/index.astro new file mode 100644 index 000000000..e12b5b4b1 --- /dev/null +++ b/src/pages/profile/index.astro @@ -0,0 +1,10 @@ +--- +import ProfileDetails from '../../components/Profile/profile-details'; +import BaseLayout from '../../layouts/BaseLayout.astro'; +--- + + +
+ +
+