Skip to content

Commit

Permalink
fix: Estimate customize values
Browse files Browse the repository at this point in the history
  • Loading branch information
abouolia committed Oct 7, 2024
1 parent 682d40c commit d92b46a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface PdfTemplateContextValue {
templateId: number | string;

// Pdf template.
pdfTemplate: GetPdfTemplateResponse;
pdfTemplate: GetPdfTemplateResponse | undefined;
isPdfTemplateLoading: boolean;

// Branding state.
Expand Down Expand Up @@ -42,8 +42,7 @@ export const BrandingTemplateBoot = ({

const isLoading = isPdfTemplateLoading ||
isBrandingTemplateLoading ||
!brandingTemplateState ||
!pdfTemplate;
!brandingTemplateState;

if (isLoading) {
return <Spinner size={20} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function EstimatePaperTemplateFormConnected() {
const { values } = useFormikContext<EstimateCustomizeValues>();
const { brandingState } = useElementCustomizeContext()

const mergedProps: EstimatePaperTemplateProps = { ...values, ...brandingState }
const mergedProps: EstimatePaperTemplateProps = { ...brandingState, ...values, }

return <EstimatePaperTemplate {...mergedProps} />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const withInvoicePreviewTemplateProps = <P extends object>(
const { values } = useFormikContext<InvoiceCustomizeFormValues>();
const { brandingState, } = useElementCustomizeContext();

const mergedProps: InvoicePaperTemplateProps = { ...brandingState, ...values }
const mergedProps: InvoicePaperTemplateProps = { ...brandingState, ...values };

return <Component {...(props as P)} {...mergedProps} />;
};
Expand Down

0 comments on commit d92b46a

Please sign in to comment.