Skip to content

Commit

Permalink
Refactor ProposalBuilder and StepButtons to Use React Node for Enhanc…
Browse files Browse the repository at this point in the history
…ed Flexibility

- Updated the ProposalBuilder component to replace JSX.Element with React.ReactNode for props including actionsExperience, stepButtons, transactionsDetails, templateDetails, and streamsDetails, allowing for greater flexibility in rendering.
- Modified the StepButtons component to change metadataStepButtons and transactionsStepButtons props from JSX.Element to React.ReactNode, improving consistency in button rendering.
- These changes aim to enhance the modularity and clarity of the proposal creation process, facilitating easier future enhancements.
  • Loading branch information
adamgall committed Jan 22, 2025
1 parent 50bbcd9 commit 616dd21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/components/ProposalBuilder/ProposalBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,26 @@ interface ProposalBuilderProps {
pageHeaderBreadcrumbs: Crumb[];
pageHeaderButtonClickHandler: () => void;
proposalMetadataTypeProps: ProposalMetadataTypeProps;
actionsExperience: JSX.Element | null;
actionsExperience: React.ReactNode | null;
stepButtons: ({
formErrors,
createProposalBlocked,
}: {
formErrors: boolean;
createProposalBlocked: boolean;
}) => JSX.Element;
}) => React.ReactNode;
transactionsDetails:
| ((transactions: CreateProposalTransaction<BigIntValuePair>[]) => JSX.Element)
| ((transactions: CreateProposalTransaction<BigIntValuePair>[]) => React.ReactNode)
| null;
templateDetails: ((title: string) => JSX.Element) | null;
streamsDetails: ((streams: Stream[]) => JSX.Element) | null;
templateDetails: ((title: string) => React.ReactNode) | null;
streamsDetails: ((streams: Stream[]) => React.ReactNode) | null;
prepareProposalData: (values: CreateProposalForm) => Promise<ProposalExecuteData | undefined>;
initialValues: CreateProposalForm;
contentRoute: (
formikProps: FormikProps<CreateProposalForm>,
pendingCreateTx: boolean,
nonce: number | undefined,
) => JSX.Element;
) => React.ReactNode;
}

export function ProposalBuilder({
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProposalBuilder/StepButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { useDaoInfoStore } from '../../store/daoInfo/useDaoInfoStore';
import { CreateProposalSteps } from '../../types';

interface StepButtonsProps {
metadataStepButtons: JSX.Element;
transactionsStepButtons: JSX.Element;
metadataStepButtons: React.ReactNode;
transactionsStepButtons: React.ReactNode;
}

export function PreviousButton({ prevStepUrl }: { prevStepUrl: string }) {
Expand Down

0 comments on commit 616dd21

Please sign in to comment.