MCPcopy Create free account
hub / github.com/dailydotdev/apps / useCanAwardUser

Function useCanAwardUser

packages/shared/src/hooks/useCoresFeature.ts:30–46  ·  view source on GitHub ↗
(props: UseCanAwardUserProps)

Source from the content-addressed store, hash-verified

28}
29
30export const useCanAwardUser = (props: UseCanAwardUserProps): boolean => {
31 const isSpecialUser = useIsSpecialUser({
32 userId: props.receivingUser?.id ?? '',
33 });
34
35 const hasAccess = useCoresFeature();
36
37 if (!props.sendingUser || !props.receivingUser) {
38 return false;
39 }
40
41 const { sendingUser, receivingUser } = props;
42
43 return (
44 hasAccess && !isSpecialUser && canAwardUser({ sendingUser, receivingUser })
45 );
46};
47
48interface UseGetSquadAwardAdminProps {
49 sendingUser: LoggedUser;

Callers 10

HeaderFunction · 0.90
ProfileActionsFunction · 0.90
CommentAwardActionsFunction · 0.90
PostActionsV1Function · 0.90
PostActionsFunction · 0.90
PostAwardActionV1Function · 0.90
PostAwardActionFunction · 0.90
ReaderRailActionBarFunction · 0.90
ReaderRailActionBarV1Function · 0.90
FocusCardActionBarFunction · 0.90

Calls 3

useIsSpecialUserFunction · 0.90
canAwardUserFunction · 0.90
useCoresFeatureFunction · 0.85

Tested by

no test coverage detected