From fed1d99e9288512871c042964efb62fc4977c7f7 Mon Sep 17 00:00:00 2001 From: Brandon Fancher Date: Fri, 19 Nov 2021 17:27:15 -0500 Subject: [PATCH 1/3] Create new Member model and apply to simple component. --- packages/webapp/src/_app/ui/nav-profile.tsx | 46 +++++++++---------- .../webapp/src/members/helpers/formatters.ts | 31 ++++++++++++- packages/webapp/src/members/hooks/queries.ts | 33 ++++++++++++- packages/webapp/src/members/interfaces.ts | 33 +++++++++++++ 4 files changed, 117 insertions(+), 26 deletions(-) diff --git a/packages/webapp/src/_app/ui/nav-profile.tsx b/packages/webapp/src/_app/ui/nav-profile.tsx index 2833a28b2..ef0f21989 100644 --- a/packages/webapp/src/_app/ui/nav-profile.tsx +++ b/packages/webapp/src/_app/ui/nav-profile.tsx @@ -4,11 +4,10 @@ import { Popover } from "@headlessui/react"; import { usePopper } from "react-popper"; import { IoMdLogIn } from "react-icons/io"; -import { MemberStatus } from "_app"; -import { useCurrentMember, useSignOut } from "_app/hooks"; -import { Button, ProfileImage, Text } from "_app/ui"; import { ROUTES } from "_app/routes"; -import { useMemberByAccountName } from "members/hooks"; +import { useSignOut } from "_app/hooks"; +import { Button, ProfileImage, Text } from "_app/ui"; +import { Member, useCurrentMember } from "members"; import { useUALAccount } from "../eos"; @@ -17,15 +16,10 @@ interface Props { } export const NavProfile = ({ location }: Props) => { - const [ualAccount, _, ualShowModal] = useUALAccount(); - const accountName = ualAccount?.accountName; - + const [_ualAccount, _, ualShowModal] = useUALAccount(); const { data: member } = useCurrentMember(); - const { data: userProfile } = useMemberByAccountName(member?.account ?? ""); - - const isActiveMember = member?.status === MemberStatus.ActiveMember; - if (!ualAccount) { + if (!member?.accountName) { return (