File tree Expand file tree Collapse file tree
modules/vaults/components Expand file tree Collapse file tree Original file line number Diff line number Diff 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-
2018export 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 >
You can’t perform that action at this time.
0 commit comments