refactor(web): remove typescript
This commit is contained in:
7
packages/web/src/components/Can/index.jsx
Normal file
7
packages/web/src/components/Can/index.jsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Can as OriginalCan } from '@casl/react';
|
||||
import * as React from 'react';
|
||||
import useCurrentUserAbility from 'hooks/useCurrentUserAbility';
|
||||
export default function Can(props) {
|
||||
const currentUserAbility = useCurrentUserAbility();
|
||||
return <OriginalCan ability={currentUserAbility} {...props} />;
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
import { Can as OriginalCan } from '@casl/react';
|
||||
import * as React from 'react';
|
||||
|
||||
import useCurrentUserAbility from 'hooks/useCurrentUserAbility';
|
||||
|
||||
type CanProps = {
|
||||
I: string;
|
||||
a: string;
|
||||
passThrough?: boolean;
|
||||
children: React.ReactNode | ((isAllowed: boolean) => React.ReactNode);
|
||||
} | {
|
||||
I: string;
|
||||
an: string;
|
||||
passThrough?: boolean;
|
||||
children: React.ReactNode | ((isAllowed: boolean) => React.ReactNode);
|
||||
};
|
||||
|
||||
export default function Can(props: CanProps) {
|
||||
const currentUserAbility = useCurrentUserAbility();
|
||||
|
||||
return (<OriginalCan ability={currentUserAbility} {...props} />);
|
||||
};
|
Reference in New Issue
Block a user