Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add Username to Profile dropdown #266

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { FC } from "react";
import { useAccount } from "src/api/hooks";
import { useAuth } from "src/api/hooks/useAuth";
import { useTutorial } from "src/api/hooks/useTutorial";
import { ETutorialTipId } from "src/api/types";
import ProfileDropdownWrapper from "./ProfileDropdownWrapper";

const ProfileDropdownContainer: FC = () => {
const { openAuthModal, isAuthenticated, logout } = useAuth();
const { userProfile } = useAccount();
const {
showTutorial,
currentTutorial,
Expand All @@ -25,6 +27,7 @@ const ProfileDropdownContainer: FC = () => {
? setTutFocusElemRef
: undefined
}
profile={userProfile}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
IconButton,
twMerge,
} from "@alphaday/ui-kit";
import { TUserProfile } from "src/api/types";
import { Logger } from "src/api/utils/logging";
import CONFIG from "src/config";
import globalMessages from "src/globalMessages";
Expand All @@ -23,6 +24,7 @@ interface IProps {
setTutFocusElemRef?:
| React.Dispatch<React.SetStateAction<HTMLElement | null>>
| undefined;
profile: TUserProfile | undefined;
}

const Divider = () => (
Expand All @@ -36,6 +38,7 @@ const ProfileDropdownWrapper: React.FC<IProps> = ({
showTutorial,
isAuthenticated,
setTutFocusElemRef,
profile,
}) => {
const [toggleState, setToggleState] = useState(false);

Expand Down Expand Up @@ -84,13 +87,16 @@ const ProfileDropdownWrapper: React.FC<IProps> = ({
{!showTutorial && (
<DropdownMenu
className={twMerge(
"two-col:p-[18px_0px] border-borderLine left-auto right-0 mt-1 w-[275px] rounded-lg rounded-t-none rounded-bl rounded-br border border-solid shadow-none",
"two-col:p-[18px_0px] border-borderLine left-auto right-0 mt-1 w-[275px] rounded-lg rounded-t rounded-bl rounded-br border border-solid shadow-none",
styles["dropdown-menu"]
)}
>
<div className="mx-2">
<div className="flex justify-between px-2 pb-5 pt-0">
<div className="flex justify-start px-2 pb-5 pt-0">
<DropdownAvatar />
<p className="m-0 self-center ml-4 capitalize fontGroup-highlight">
{profile?.user.username}
</p>
</div>
<Divider />
<DropdownItem
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-kit/src/components/dropdown/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ export const Dropdown: FC<DropdownProps> = ({

export const DropdownAvatar: FC = () => {
return (
<div className="bg-backgroundVariant200 relative h-16 w-16 rounded-full">
<div className="bg-backgroundVariant200 relative h-12 w-12 rounded-full">
<div className="absolute inset-0 flex h-full w-full items-center justify-center rounded-full text-4 font-bold uppercase leading-[100%] text-primary">
<div>
<UserSVG className="fill-primary w-5" />
<UserSVG className="fill-primary w-4" />
</div>
</div>
</div>
Expand Down
Loading