Files
formbricks-formbricks/apps/web/lib/preview.ts
Dhruwang Jariwala 98cdf941e6 Improve Preview in Survey Editor with Mobile & Desktop View (#573)
* made modal component responsive

* added tab switch

* added mobile preview mode for surveys

* did some refactors

* did some refactors

* added type defs

* ran pnpm format

* removed an unused comment

* fixed variable name typo

* fixed UI bugs and added mobile mockup to link surveys

* restored changes from fix long description PR

* fixed scroll to top issue and toggle hide bug

* fixed minor animation bug

* fixed placement issue

* re-embed restart button, make phone preview more responsive

---------

Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
2023-08-11 10:55:49 +02:00

19 lines
544 B
TypeScript

import { PlacementType } from "@formbricks/types/js";
export const getPlacementStyle = (placement: PlacementType) => {
switch (placement) {
case "bottomRight":
return "bottom-3 sm:right-3";
case "topRight":
return "sm:top-3 sm:right-3 bottom-3";
case "topLeft":
return "sm:top-3 sm:left-3 bottom-3";
case "bottomLeft":
return "bottom-3 sm:left-3";
case "center":
return "top-1/2 left-1/2 transform !-translate-x-1/2 -translate-y-1/2";
default:
return "bottom-3 sm:right-3";
}
};