Move method that gets the current user to a separate file

pull/2657/head^2
Julián Sánchez 2022-04-29 11:15:40 -05:00 committed by Omar López
parent daf39a4095
commit 06f88eb5a3
2 changed files with 8 additions and 7 deletions

View File

@ -21,10 +21,10 @@ import { trpc, inferQueryOutput } from "@lib/trpc";
import { Tooltip } from "@components/Tooltip";
import ConfirmationDialogContent from "@components/dialog/ConfirmationDialogContent";
import { useCurrentUser } from "@components/team/currentUser";
import Avatar from "@components/ui/Avatar";
import ModalContainer from "@components/ui/ModalContainer";
import { useMeQuery } from "../Shell";
import MemberChangeRoleModal from "./MemberChangeRoleModal";
import TeamPill, { TeamRole } from "./TeamPill";
@ -56,12 +56,6 @@ export default function MemberListItem(props: Props) {
return owners.length;
};
const useCurrentUser = () => {
const query = useMeQuery();
const user = query.data;
return user?.id;
};
const currentUser = useCurrentUser();
const name =

View File

@ -0,0 +1,7 @@
import { useMeQuery } from "@components/Shell";
export const useCurrentUser = () => {
const query = useMeQuery();
const user = query.data;
return user?.id;
};