Skip to content

Commit

Permalink
Merge pull request #417 from HausDAO/feat/open-safe-actions
Browse files Browse the repository at this point in the history
remove member check on safes action menu, open to any connected member
  • Loading branch information
skuhlmann authored Sep 13, 2023
2 parents 5e10b4a + b9f3e02 commit 824ce8e
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions libs/moloch-v3-macro-ui/src/components/SafeCard/SafeActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import {
DropdownTrigger,
DropdownContent,
} from '@daohaus/ui';
import { getNetwork, Keychain } from '@daohaus/keychain-utils';
import { getNetwork } from '@daohaus/keychain-utils';
import { SafeActionMenuLink, SafeActionMenuTrigger } from './SafeCard.styles';
import { useDaoMember } from '@daohaus/moloch-v3-hooks';
import { useDHConnect } from '@daohaus/connect';

type SafeActionMenuProps = {
Expand All @@ -25,22 +24,14 @@ export const SafeActionMenu = ({
daoId,
}: SafeActionMenuProps) => {
const { address } = useDHConnect();
const { member } = useDaoMember({
daoId,
daoChain: daoChain as keyof Keychain,
memberAddress: address,
});

const enableActions = useMemo(() => {
return member && Number(member.shares) > 0;
}, [member]);

const networkData = useMemo(() => {
if (!daoChain) return null;
return getNetwork(daoChain);
}, [daoChain]);

if (!enableActions) return null;
// must be connected to view action menu
if (!address) return null;

return (
<DropdownMenu>
Expand Down

0 comments on commit 824ce8e

Please sign in to comment.