fix: fixed overlay

This commit is contained in:
Anjy Gupta
2023-11-13 17:27:18 +00:00
parent 862e72ca8f
commit 6711543cdf
@@ -1,14 +1,15 @@
export default function PreviewSurveyBgDeskstop({ children, survey, ContentRef }) {
return survey.surveyBackground && survey.surveyBackground.bgType === "color" ? (
<div className="flex flex-grow flex-col overflow-y-auto rounded-b-lg" ref={ContentRef}>
<div
className="relative flex w-full flex-grow flex-col items-center justify-center p-4 py-6"
style={{
backgroundColor: survey.surveyBackground.bg || "#ffff",
filter: survey.surveyBackground?.brightness
? `brightness(${survey.surveyBackground.brightness}%)`
: "none",
}}>
<div className="relative flex w-full flex-grow flex-col items-center justify-center p-4 py-6">
<div
className="absolute inset-0 h-full w-full object-cover"
style={{
backgroundColor: survey.surveyBackground.bg,
filter: survey.surveyBackground?.brightness
? `brightness(${survey.surveyBackground.brightness}%)`
: "none",
}}></div>
<div className="flex h-full w-full items-center justify-center">{children}</div>
</div>
</div>
@@ -37,14 +38,16 @@ export default function PreviewSurveyBgDeskstop({ children, survey, ContentRef }
</div>
) : survey.surveyBackground && survey.surveyBackground.bgType === "image" ? (
<div className="flex flex-grow flex-col overflow-y-auto rounded-b-lg" ref={ContentRef}>
<div
className="relative flex w-full flex-grow flex-col items-center justify-center p-4 py-6"
style={{
backgroundImage: `url(${survey.surveyBackground.bg})`,
filter: survey.surveyBackground?.brightness
? `brightness(${survey.surveyBackground.brightness}%)`
: "none",
}}>
<div className="relative flex w-full flex-grow flex-col items-center justify-center p-4 py-6">
<div
className="absolute inset-0 h-full w-full object-cover"
style={{
backgroundImage: `url(${survey.surveyBackground.bg})`,
backgroundSize: "cover",
filter: survey.surveyBackground?.brightness
? `brightness(${survey.surveyBackground.brightness}%)`
: "none",
}}></div>
<div className="flex h-full w-full items-center justify-center">{children}</div>
</div>
</div>