@@ -15,6 +15,7 @@ import { SupportedLambdaProposalKey } from "services/bakingBad/lambdas"
1515import { ProposalAction , ProposalFormLambda } from "modules/explorer/components/ConfigProposalFormLambda"
1616import { useDAO } from "services/services/dao/hooks/useDAO"
1717import { ProposalCreatorModal } from "modules/lite/explorer/pages/CreateProposal/ProposalCreatorModal"
18+ import { useIsProposalButtonDisabled } from "services/contracts/baseDAO/hooks/useCycleInfo"
1819
1920type RecursivePartial < T > = {
2021 [ P in keyof T ] ?: RecursivePartial < T [ P ] >
@@ -123,6 +124,7 @@ export const ProposalActionsDialog: React.FC<Props> = ({ open, handleClose }) =>
123124 const [ openProposalFormLambda , setOpenProposalFormLambda ] = useState ( false )
124125 const [ openLiteProposal , setOpenLiteProposal ] = useState ( false )
125126 const liteDAOId = data ?. liteDAOData ?. _id
127+ const shouldDisable = useIsProposalButtonDisabled ( daoId )
126128
127129 const handleOpenCustomProposalModal = ( key : ProposalAction ) => {
128130 setProposalAction ( key )
@@ -167,13 +169,21 @@ export const ProposalActionsDialog: React.FC<Props> = ({ open, handleClose }) =>
167169 onClick = { ( ) =>
168170 elem . id === "off-chain"
169171 ? handleLiteProposal ( )
170- : elem . isLambda
171- ? handleOpenCustomProposalModal ( elem . id )
172- : handleOpenSupportedExecuteProposalModal ( elem . id )
172+ : ! shouldDisable
173+ ? elem . isLambda
174+ ? handleOpenCustomProposalModal ( elem . id )
175+ : handleOpenSupportedExecuteProposalModal ( elem . id )
176+ : null
173177 }
174178 >
175- < ActionText color = "textPrimary" > { elem . name } </ ActionText >
176- < ActionDescriptionText color = "textPrimary" > { elem . description } </ ActionDescriptionText >
179+ < ActionText color = { shouldDisable && elem . id !== "off-chain" ? "textSecondary" : "textPrimary" } >
180+ { elem . name }
181+ </ ActionText >
182+ < ActionDescriptionText
183+ color = { shouldDisable && elem . id !== "off-chain" ? "textSecondary" : "textPrimary" }
184+ >
185+ { elem . description } { " " }
186+ </ ActionDescriptionText >
177187 </ OptionContainer >
178188 </ Grid >
179189 )
0 commit comments