Files
formbricks-formbricks/packages/lib/utils/styling.ts
Anshuman Pandey 647a05f469 fix: survey editor validation (#2749)
Co-authored-by: Matti Nannt <mail@matthiasnannt.com>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
Co-authored-by: Johannes <johannes@formbricks.com>
2024-07-09 14:33:09 +00:00

23 lines
648 B
TypeScript

import { TProduct } from "@formbricks/types/product";
import { TSurvey } from "@formbricks/types/surveys/types";
export const getStyling = (product: TProduct, survey: TSurvey) => {
// allow style overwrite is disabled from the product
if (!product.styling.allowStyleOverwrite) {
return product.styling;
}
// allow style overwrite is enabled from the product
if (product.styling.allowStyleOverwrite) {
// survey style overwrite is disabled
if (!survey.styling?.overwriteThemeStyling) {
return product.styling;
}
// survey style overwrite is enabled
return survey.styling;
}
return product.styling;
};