Move method that gets the current user to a separate file
parent
daf39a4095
commit
06f88eb5a3
|
@ -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 =
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
import { useMeQuery } from "@components/Shell";
|
||||
|
||||
export const useCurrentUser = () => {
|
||||
const query = useMeQuery();
|
||||
const user = query.data;
|
||||
return user?.id;
|
||||
};
|
Loading…
Reference in New Issue