chore: Quick refactor to usePolicy hook (#3161)
This commit is contained in:
@@ -9,6 +9,7 @@ import ContextMenu from "~/components/ContextMenu";
|
||||
import MenuItem from "~/components/ContextMenu/MenuItem";
|
||||
import OverflowMenuButton from "~/components/ContextMenu/OverflowMenuButton";
|
||||
import CopyToClipboard from "~/components/CopyToClipboard";
|
||||
import usePolicy from "~/hooks/usePolicy";
|
||||
import useStores from "~/hooks/useStores";
|
||||
import useToasts from "~/hooks/useToasts";
|
||||
|
||||
@@ -20,11 +21,11 @@ function ShareMenu({ share }: Props) {
|
||||
const menu = useMenuState({
|
||||
modal: true,
|
||||
});
|
||||
const { shares, policies } = useStores();
|
||||
const { shares } = useStores();
|
||||
const { showToast } = useToasts();
|
||||
const { t } = useTranslation();
|
||||
const history = useHistory();
|
||||
const can = policies.abilities(share.id);
|
||||
const can = usePolicy(share.id);
|
||||
|
||||
const handleGoToDocument = React.useCallback(
|
||||
(ev: React.SyntheticEvent) => {
|
||||
|
||||
Reference in New Issue
Block a user