-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/UnitapApp/unitap-front
- Loading branch information
Showing
7 changed files
with
76 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"use client"; | ||
import { useRef, useState } from "react"; | ||
import { useOutsideClick } from "@/utils/hooks/dom"; | ||
import { useUserProfileContext } from "@/context/userProfile"; | ||
import { RenderNavbarWalletAddress, ProfileDropdown } from "./auth"; | ||
|
||
export const UserAuthStatus = () => { | ||
const divRef = useRef<HTMLDivElement>(null); | ||
|
||
const [dropDownActive, setDropDownActive] = useState(false); | ||
|
||
useOutsideClick(divRef, () => setDropDownActive(false)); | ||
|
||
const { userProfile } = useUserProfileContext(); | ||
|
||
return ( | ||
<div ref={divRef} className="md:relative ml-5"> | ||
<div className={`ml-5 p-[1px] rounded-lg mr-3`} id="profile-dropdown"> | ||
<div className="cursor-pointer flex rounded-lg h-9 items-center justify-between bg-gray40"> | ||
<div | ||
onClick={() => { | ||
if (!userProfile) return; | ||
setDropDownActive(!dropDownActive); | ||
}} | ||
className="cursor-pointer relative z-20 pr-0.5 pl-2 flex rounded-lg h-9 items-center justify-between bg-gray40" | ||
> | ||
<span className="ml-2 hidden md:block text-sm"> | ||
@ {userProfile?.username || `User${userProfile.pk}`} | ||
</span> | ||
|
||
<span className="text-gray90 hidden md:block ml-8 mr-5"> | ||
level: ?{" "} | ||
</span> | ||
<RenderNavbarWalletAddress /> | ||
</div> | ||
|
||
{dropDownActive && ( | ||
<ProfileDropdown setDropDownActive={setDropDownActive} /> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters