mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix: Estimate customize values
This commit is contained in:
@@ -11,7 +11,7 @@ interface PdfTemplateContextValue {
|
|||||||
templateId: number | string;
|
templateId: number | string;
|
||||||
|
|
||||||
// Pdf template.
|
// Pdf template.
|
||||||
pdfTemplate: GetPdfTemplateResponse;
|
pdfTemplate: GetPdfTemplateResponse | undefined;
|
||||||
isPdfTemplateLoading: boolean;
|
isPdfTemplateLoading: boolean;
|
||||||
|
|
||||||
// Branding state.
|
// Branding state.
|
||||||
@@ -42,8 +42,7 @@ export const BrandingTemplateBoot = ({
|
|||||||
|
|
||||||
const isLoading = isPdfTemplateLoading ||
|
const isLoading = isPdfTemplateLoading ||
|
||||||
isBrandingTemplateLoading ||
|
isBrandingTemplateLoading ||
|
||||||
!brandingTemplateState ||
|
!brandingTemplateState;
|
||||||
!pdfTemplate;
|
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return <Spinner size={20} />;
|
return <Spinner size={20} />;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ function EstimatePaperTemplateFormConnected() {
|
|||||||
const { values } = useFormikContext<EstimateCustomizeValues>();
|
const { values } = useFormikContext<EstimateCustomizeValues>();
|
||||||
const { brandingState } = useElementCustomizeContext()
|
const { brandingState } = useElementCustomizeContext()
|
||||||
|
|
||||||
const mergedProps: EstimatePaperTemplateProps = { ...values, ...brandingState }
|
const mergedProps: EstimatePaperTemplateProps = { ...brandingState, ...values, }
|
||||||
|
|
||||||
return <EstimatePaperTemplate {...mergedProps} />;
|
return <EstimatePaperTemplate {...mergedProps} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const withInvoicePreviewTemplateProps = <P extends object>(
|
|||||||
const { values } = useFormikContext<InvoiceCustomizeFormValues>();
|
const { values } = useFormikContext<InvoiceCustomizeFormValues>();
|
||||||
const { brandingState, } = useElementCustomizeContext();
|
const { brandingState, } = useElementCustomizeContext();
|
||||||
|
|
||||||
const mergedProps: InvoicePaperTemplateProps = { ...brandingState, ...values }
|
const mergedProps: InvoicePaperTemplateProps = { ...brandingState, ...values };
|
||||||
|
|
||||||
return <Component {...(props as P)} {...mergedProps} />;
|
return <Component {...(props as P)} {...mergedProps} />;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user