mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-17 19:14:53 -05:00
fix: added props interface to new components
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
import { useState } from "react";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
|
||||
export default function AnimatedSurveyBg({ localSurvey, handleBgChange }) {
|
||||
const [color, setColor] = useState(localSurvey.surveyBackground?.bg || "#ffff");
|
||||
interface AnimatedSurveyBgProps {
|
||||
localSurvey?: TSurvey;
|
||||
handleBgChange: (bg: string, bgType: string) => void;
|
||||
}
|
||||
|
||||
export default function AnimatedSurveyBg({ localSurvey, handleBgChange }: AnimatedSurveyBgProps) {
|
||||
const [color, setColor] = useState(localSurvey?.surveyBackground?.bg || "#ffff");
|
||||
const [hoveredVideo, setHoveredVideo] = useState<number | null>(null);
|
||||
|
||||
const animationFiles = {
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import { useState } from "react";
|
||||
import { ColorPicker } from "@formbricks/ui/ColorPicker";
|
||||
import { Label } from "@formbricks/ui/Label";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
|
||||
export default function ColorSurveyBg({ localSurvey, handleBgChange }) {
|
||||
interface ColorSurveyBgBgProps {
|
||||
localSurvey?: TSurvey;
|
||||
handleBgChange: (bg: string, bgType: string) => void;
|
||||
}
|
||||
|
||||
export default function ColorSurveyBg({ localSurvey, handleBgChange }: ColorSurveyBgBgProps) {
|
||||
const colours = [
|
||||
"#FFF2D8",
|
||||
"#EAD7BB",
|
||||
@@ -30,7 +36,7 @@ export default function ColorSurveyBg({ localSurvey, handleBgChange }) {
|
||||
"#CDFAD5",
|
||||
];
|
||||
|
||||
const [color, setColor] = useState(localSurvey.surveyBackground?.bg || "#ffff");
|
||||
const [color, setColor] = useState(localSurvey?.surveyBackground?.bg || "#ffff");
|
||||
|
||||
const handleBg = (x: string) => {
|
||||
setColor(x);
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
import FileInput from "@formbricks/ui/FileInput";
|
||||
import { TSurvey } from "@formbricks/types/surveys";
|
||||
|
||||
export default function ImageSurveyBg({ localSurvey, handleBgChange }) {
|
||||
interface ImageSurveyBgBgProps {
|
||||
localSurvey?: TSurvey;
|
||||
handleBgChange: (url: string, bgType: string) => void;
|
||||
}
|
||||
|
||||
export default function ImageSurveyBg({ localSurvey, handleBgChange }: ImageSurveyBgBgProps) {
|
||||
return (
|
||||
<div className="mb-2 mt-4 w-full rounded-lg border bg-slate-50 p-4">
|
||||
<div className="mt-3 flex w-full items-center justify-center">
|
||||
<FileInput
|
||||
id="choices-file-input"
|
||||
allowedFileExtensions={["png", "jpeg", "jpg"]}
|
||||
environmentId={localSurvey.environmentId}
|
||||
onFileUpload={(url: string[]) => {
|
||||
environmentId={localSurvey?.environmentId}
|
||||
onFileUpload={(url: string) => {
|
||||
handleBgChange(url, "image");
|
||||
}}
|
||||
fileUrl={localSurvey?.welcomeCard?.fileUrl}
|
||||
|
||||
@@ -17,7 +17,7 @@ interface FileInputProps {
|
||||
id: string;
|
||||
allowedFileExtensions: TAllowedFileExtensions[];
|
||||
environmentId: string | undefined;
|
||||
onFileUpload: (uploadedUrl: string[] | undefined) => void;
|
||||
onFileUpload: (uploadedUrl: string[] | string | undefined) => void;
|
||||
fileUrl?: string | string[];
|
||||
multiple?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user