Skip to content

Commit 527de2f

Browse files
committed
fix: roles text
1 parent 968ba24 commit 527de2f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

modules/vaults/components/permissioned-submit-button.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ type PermissionedSubmitProps = {
1515
dashboardRole: VAULTS_ALL_ROLES;
1616
} & ComponentProps<typeof Button>;
1717

18-
const capitilize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
19-
2018
export const PermissionedSubmitButton = forwardRef<
2119
HTMLButtonElement,
2220
PermissionedSubmitProps
@@ -62,11 +60,15 @@ export const MultiplePermissionedSubmitButton = forwardRef<
6260
const shouldShowPermissionError =
6361
!isLoading && data && !data.hasPermissions && isAccountActive;
6462

63+
const missingRoles = data?.missingRoles
64+
.map((role) => vaultTexts.roles[role].title)
65+
.join(', ');
66+
6567
return (
6668
<ConnectWalletButton>
6769
<Button disabled={shouldDisable} ref={ref} {...rest}>
6870
{shouldShowPermissionError
69-
? `You don't have ${data?.missingRoles.map(capitilize).join(', ')} role${data && data.missingRoles.length > 1 ? 's' : ''}`
71+
? `You don't have ${missingRoles} role${data && data.missingRoles.length > 1 ? 's' : ''}`
7072
: children}
7173
</Button>
7274
</ConnectWalletButton>

0 commit comments

Comments
 (0)