Skip to content

Commit

Permalink
feat(gno/dao): allow dao kind to be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelVallenet committed Jan 2, 2025
1 parent 4a78eda commit 532c09e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/screens/UserPublicProfile/components/UPPIntro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export const UPPIntro: React.FC<{
},
]}
>
{metadata.dao_kind}
{daoKind}
</BrandText>
</View>
)}
Expand Down
7 changes: 4 additions & 3 deletions packages/utils/gnodao/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ export const getPercent = (num: number | undefined): string => {
return (ret_num / 100).toFixed(2);
};

export const extractDaoKind = (votingModuleInfo: string): string => {
export const extractDaoKind = (
votingModuleInfo: string,
): string | undefined => {
const rawDaoKind = votingModuleInfo.split("@v")[0];
console.log("rawDaoKind", rawDaoKind);
switch (rawDaoKind) {
case "gno.land/p/teritori/dao_roles_voting_group":
return "roles based organization";
case "gno.land/p/teritori/dao_voting_group":
return "memberships based organization";
default:
return "";
return undefined;
}
};

0 comments on commit 532c09e

Please sign in to comment.