mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-08 14:50:36 -06:00
* add placement enum and prop to db scheme * enable placement toggle in setttings * enable in-app survey placement demo * add position helper function * add placement to in-app-modal preview * add placement prop to api endpoint * add placement to widget * remove coming soon * add styling * add apply tailwind styles instead of a ts function * add clickoutside and darkoverlay prop * add darkOverlay and clickOutside form * update js package tailwind apply classes * add background to widget and close on click outside * only show backdrop and clickOutside if is center * only display background when modal is centered * responsive changes in js widget * add updated migration, move styles from global.css to function --------- Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
19 lines
543 B
TypeScript
19 lines
543 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";
|
|
}
|
|
};
|