mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-06 05:40:02 -06:00
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>
23 lines
648 B
TypeScript
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;
|
|
};
|