mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-26 03:35:38 -05:00
fc150170d0
Co-authored-by: Matti Nannt <mail@matthiasnannt.com>
23 lines
642 B
TypeScript
23 lines
642 B
TypeScript
import { TProduct } from "@formbricks/types/product";
|
|
import { TSurvey } from "@formbricks/types/surveys";
|
|
|
|
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;
|
|
};
|