fix: fix invalid state initialisation (#1220)

Co-authored-by: Johannes <johannes@formbricks.com>
This commit is contained in:
Naresh
2023-10-16 17:53:41 +05:30
committed by GitHub
parent 5ac5e5162f
commit 98ad73cee6
3 changed files with 3 additions and 7 deletions
@@ -27,7 +27,6 @@ export const GitHubSponsorship: React.FC = () => {
src={HackIconGold}
alt="Hacktober Icon Gold"
width={100}
height={100}
className="mr-12 md:mr-4"
/>
</div>
@@ -1,6 +1,6 @@
import { useEffect, useRef, useState } from "react";
import type { LottiePlayer } from "lottie-web";
import Image from "next/image";
import { useEffect, useRef, useState } from "react";
export const HeroAnimation: React.FC<any> = ({ fallbackImage, ...props }) => {
const [loaded, setLoaded] = useState(false);
@@ -18,7 +18,6 @@ export const HeroAnimation: React.FC<any> = ({ fallbackImage, ...props }) => {
renderer: "svg",
loop: true,
autoplay: true,
// path to your animation file, place it inside public folder
path: "/animations/opensource-xm-platform-formbricks.json",
});
@@ -36,11 +35,9 @@ export const HeroAnimation: React.FC<any> = ({ fallbackImage, ...props }) => {
{!loaded && (
<div className="absolute inset-0">
<Image
priority
src={fallbackImage}
alt="Fallback Image"
layout="fill"
objectFit="cover"
objectPosition="center"
className="transition-opacity duration-300"
style={{ opacity: loaded ? 0 : 1 }}
/>
@@ -45,7 +45,7 @@ function SystemIcon(props) {
}
export function ThemeSelector(props) {
let [selectedTheme, setSelectedTheme] = useState();
const [selectedTheme, setSelectedTheme] = useState(null);
useEffect(() => {
if (selectedTheme) {