UNPKG

react-garden

Version:

React + TypeScript + ThreeJS app using Material UI on NextJS, Apollo Client, GraphQL + WordPress REST APIs, for ThreeD web development.. a part of the threed.ai code family.

18 lines (12 loc) 431 B
// ** React Imports import { useContext } from 'react' // ** Component Imports import { AbilityContext } from '~/layouts/components/acl/Can' const CanViewNavLink = props => { // ** Props const { children, navLink } = props // ** Hook const ability = useContext(AbilityContext) return ability && ability.can(navLink?.action, navLink?.subject) ? <>{children}</> : null } export default CanViewNavLink