mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-19 03:04:39 -05:00
60f6ca9463
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
22 lines
691 B
TypeScript
22 lines
691 B
TypeScript
import { TJsWorkspaceStateSurvey, TJsWorkspaceStateWorkspaceSetting } from "@formbricks/types/js";
|
|
|
|
export const getStyling = (workspace: TJsWorkspaceStateWorkspaceSetting, survey: TJsWorkspaceStateSurvey) => {
|
|
// allow style overwrite is disabled from the workspace
|
|
if (!workspace.styling.allowStyleOverwrite) {
|
|
return workspace.styling;
|
|
}
|
|
|
|
// allow style overwrite is enabled from the workspace
|
|
if (workspace.styling.allowStyleOverwrite) {
|
|
// survey style overwrite is disabled
|
|
if (!survey.styling?.overwriteThemeStyling) {
|
|
return workspace.styling;
|
|
}
|
|
|
|
// survey style overwrite is enabled
|
|
return survey.styling;
|
|
}
|
|
|
|
return workspace.styling;
|
|
};
|