diff --git a/components/atg/Editor/editor/code.tsx b/components/atg/Editor/editor/code.tsx
index 5b53455e..d902e9a4 100644
--- a/components/atg/Editor/editor/code.tsx
+++ b/components/atg/Editor/editor/code.tsx
@@ -14,7 +14,7 @@ export const Code = ({
selectedFileName,
}: {
selectedFile: File | undefined;
- showSideBannerBool: Boolean;
+ showSideBannerBool: boolean;
RemoveSideBanner: () => void;
settingCodeTheme: boolean;
isFullScreen: boolean;
@@ -83,23 +83,23 @@ export const Code = ({
// Add event listener to window resize to handle screen transition
window.addEventListener("resize", layoutEditor);
- return () => window.removeEventListener("resize", layoutEditor);
+ return () => { window.removeEventListener("resize", layoutEditor); };
}
}, [isFullScreen, monacoInstance]);
const validateCode = (code: string) => {
const diagnostics: monaco.editor.IMarkerData[] = [];
- let stack: { char: string; position: number }[] = [];
+ const stack: { char: string; position: number }[] = [];
const openBrackets = "{[(";
const closeBrackets = "}])";
- const matchingBracket: { [key: string]: string } = {
+ const matchingBracket: Record
= {
"}": "{",
"]": "[",
")": "(",
};
const stringDelimiters = ['"', "'", "`"];
- let stringStack: { char: string; position: number }[] = [];
+ const stringStack: { char: string; position: number }[] = [];
for (let i = 0; i < code.length; i++) {
const char = code[i];
@@ -181,8 +181,8 @@ export const Code = ({
};
validate(); // Initial validation
- const subscription = model.onDidChangeContent(() => validate());
- return () => subscription.dispose();
+ const subscription = model.onDidChangeContent(() => { validate(); });
+ return () => { subscription.dispose(); };
}
}
}, [monacoInstance]);
@@ -237,8 +237,8 @@ export const Code = ({
/>
{!showSideBannerBool && (
setShowText(true)}
- onMouseLeave={() => setShowText(false)}
+ onMouseEnter={() => { setShowText(true); }}
+ onMouseLeave={() => { setShowText(false); }}
className={`p-2 absolute z-10 hover:cursor-pointer border border-gray-500 border-b-0 right-0 top-1/2 bg-secondary-300 flex items-center justify-center shadow-lg transition-all duration-500`}
style={{
transform: "translateY(-50%)",
diff --git a/components/atg/Editor/utils/File-Structure.ts b/components/atg/Editor/utils/File-Structure.ts
index e5fdd35f..a6486c97 100644
--- a/components/atg/Editor/utils/File-Structure.ts
+++ b/components/atg/Editor/utils/File-Structure.ts
@@ -5,7 +5,7 @@ import { Directory, generateUniqueId, Type, File } from "./file-manager";
export function createFileStructure(
rootPath: string,
- depth: number = 0,
+ depth = 0,
parentId: string | undefined = undefined
): Directory {
// Get the base name of the root path
diff --git a/components/atg/Editor/utils/api-functions.ts b/components/atg/Editor/utils/api-functions.ts
index b1e4f8b9..6f94923b 100644
--- a/components/atg/Editor/utils/api-functions.ts
+++ b/components/atg/Editor/utils/api-functions.ts
@@ -457,7 +457,7 @@ export const makeKeployTestDir = async ({
if (testing) {
console.log("Starting testing process...");
- let reportDirs = keployDir.dirs.find((dir) => dir.name === "Reports");
+ const reportDirs = keployDir.dirs.find((dir) => dir.name === "Reports");
let newReportDir: Directory;
if (!reportDirs) {
@@ -516,7 +516,7 @@ export const removeKeployTestDir = async (rootDir: Directory): Promise dir.name === "Keploy");
+ const keployDir = rootDir.dirs.find((dir) => dir.name === "Keploy");
if (keployDir) {
// Remove the Keploy directory
diff --git a/components/atg/Terminal/hooks.tsx b/components/atg/Terminal/hooks.tsx
index 6bbf59e9..8e2993ef 100644
--- a/components/atg/Terminal/hooks.tsx
+++ b/components/atg/Terminal/hooks.tsx
@@ -8,7 +8,7 @@ import {
export const useTerminal = () => {
const [terminalRef, setDomNode] = useState();
const setTerminalRef = useCallback(
- (node: HTMLDivElement) => setDomNode(node),
+ (node: HTMLDivElement) => { setDomNode(node); },
[]
);
@@ -19,7 +19,7 @@ export const useTerminal = () => {
useEffect(() => {
const windowResizeEvent = () => {
terminalRef?.scrollTo({
- top: terminalRef?.scrollHeight ?? 99999,
+ top: terminalRef.scrollHeight ?? 99999,
behavior: "smooth",
});
};
@@ -35,7 +35,7 @@ export const useTerminal = () => {
*/
useEffect(() => {
terminalRef?.scrollTo({
- top: terminalRef?.scrollHeight ?? 99999,
+ top: terminalRef.scrollHeight ?? 99999,
behavior: "smooth",
});
}, [history, terminalRef]);
@@ -56,7 +56,7 @@ export const useTerminal = () => {
new Promise((resolve) => {
setTimeout(() => {
pushToHistory(content);
- return resolve(content);
+ resolve(content);
}, delay);
}),
[pushToHistory]
diff --git a/components/atg/Terminal/index.tsx b/components/atg/Terminal/index.tsx
index e08e627e..5a522818 100644
--- a/components/atg/Terminal/index.tsx
+++ b/components/atg/Terminal/index.tsx
@@ -75,9 +75,9 @@ export const Terminal = forwardRef(
const handleInputKeyDown = useCallback(
(e: React.KeyboardEvent) => {
if (e.key === "Enter") {
- const commandToExecute = commands?.[input];
+ const commandToExecute = commands[input];
if (commandToExecute) {
- commandToExecute?.();
+ commandToExecute();
} else {
handleCommandNotFound();
}
@@ -184,9 +184,7 @@ export const Terminal = forwardRef(
))}
{!Loading ? (
<>
diff --git a/components/atg/Terminal/types.ts b/components/atg/Terminal/types.ts
index 788b1fcc..4aca09ab 100644
--- a/components/atg/Terminal/types.ts
+++ b/components/atg/Terminal/types.ts
@@ -2,19 +2,17 @@ import {ReactNode} from "react";
export type TerminalHistoryItem = ReactNode | string;
export type TerminalHistory = TerminalHistoryItem[];
-export type TerminalPushToHistoryWithDelayProps = {
+export interface TerminalPushToHistoryWithDelayProps {
content: TerminalHistoryItem;
delay?: number;
-};
+}
-export type TerminalCommands = {
- [command: string]: () => void;
-};
+export type TerminalCommands = Record
void>;
-export type TerminalProps = {
+export interface TerminalProps {
history: TerminalHistory;
promptLabel?: TerminalHistoryItem;
commands: TerminalCommands;
-};
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/components/atg/components/AppBar.tsx b/components/atg/components/AppBar.tsx
index 9e00e6ae..22e34dfa 100644
--- a/components/atg/components/AppBar.tsx
+++ b/components/atg/components/AppBar.tsx
@@ -80,28 +80,26 @@ const Appbar = ({
handleMouseEnter(file.id)}
+ onMouseEnter={() => { handleMouseEnter(file.id); }}
onMouseLeave={handleMouseLeave}
>
@@ -110,14 +108,14 @@ const Appbar = ({
className={`text-xs mx-1 italic ${
AppBarTheme ? "text-slate-900" : "text-white"
} h-full `}
- onClick={() => onSelect(file)}
+ onClick={() => { onSelect(file); }}
>
{file.name}
{selectedFile?.id != file.id && (
)}
- {selectedFile?.id == file?.id && (
-
- setFormOpen(false)} />
+ { setFormOpen(false); }} />
);
}
diff --git a/components/pillar-page/community.tsx b/components/pillar-page/community.tsx
index ae4ffbe6..6114ef8b 100644
--- a/components/pillar-page/community.tsx
+++ b/components/pillar-page/community.tsx
@@ -20,8 +20,8 @@ const SocialCloud: React.FC = () => {
rel="noopener noreferrer"
className={`social-link link-${index + 1}`}
title={link.title}
- onMouseEnter={() => setValue(link.description)}
- onMouseLeave={() => setValue(" Where Code Meets Community!")}
+ onMouseEnter={() => { setValue(link.description); }}
+ onMouseLeave={() => { setValue(" Where Code Meets Community!"); }}
>
{link.icon}
diff --git a/components/pillar-page/feature.tsx b/components/pillar-page/feature.tsx
index 5022d899..8acf4cd8 100644
--- a/components/pillar-page/feature.tsx
+++ b/components/pillar-page/feature.tsx
@@ -5,13 +5,13 @@ export default function Features(props: {
subtitle: string;
highlightTitle: string;
title2: string;
- featuresData: Array<{
+ featuresData: {
title: string;
description: string;
icon: ReactElement;
additionalCta?:string;
additionalCtaLink?:string;
- }>;
+ }[];
}) {
return (
diff --git a/components/ui/header.tsx b/components/ui/header.tsx
index e0a0a597..4b01b801 100644
--- a/components/ui/header.tsx
+++ b/components/ui/header.tsx
@@ -7,7 +7,10 @@ import Logo from "./logo";
import MobileMenu from "./mobile-menu";
import CountingNumbers from "../utils/countingNumbers";
import { isTypeOfExpression } from "typescript";
-import NavItemWithSmallDropdown, {DropdowndataInterface,LinkDatainterface} from "@/components/nav/navItemWithSmallDropdown";
+import NavItemWithSmallDropdown, {
+ DropdowndataInterface,
+ LinkDatainterface,
+} from "@/components/nav/navItemWithSmallDropdown";
import { PillarPages } from "../utils/resources";
import { StarIcon } from "@heroicons/react/24/solid";
export default function Header() {
@@ -21,7 +24,7 @@ export default function Header() {
useEffect(() => {
scrollHandler();
window.addEventListener("scroll", scrollHandler);
- return () => window.removeEventListener("scroll", scrollHandler);
+ return () => { window.removeEventListener("scroll", scrollHandler); };
}, [top]);
useEffect(() => {
@@ -33,7 +36,7 @@ export default function Header() {
if (response.ok) {
const data = await response.json();
// Convert starsCount to 1-digit decimal with 'K'
- let stars = data.stargazers_count;
+ const stars = data.stargazers_count;
// let roundedStars = Math.round(data.stargazers_count / 50) * 50;
// let formattedStars = (roundedStars / 1000).toFixed(1) + "K";
setStarsCount(stars);
@@ -69,8 +72,8 @@ export default function Header() {
{/* Desktop navigation */}
-
+
{/* Sliding effect span */}
-
+
- |
+
+ {" "}
+ |{" "}
+
-
+
+ {" "}
+
+
+
+
+
+
+
Sign In
+ {/*
*/}
+ {/* */}
+ {/**/}
-
-
-
Sign In
- {/*
*/}
- {/* */}
- {/**/}
-
-
diff --git a/components/ui/mobile-menu.tsx b/components/ui/mobile-menu.tsx
index 20012490..eee9ee16 100644
--- a/components/ui/mobile-menu.tsx
+++ b/components/ui/mobile-menu.tsx
@@ -32,7 +32,7 @@ const MobileMenu: React.FC
= ({ starsCount }) => {
setMobileNavOpen(false);
};
document.addEventListener("click", clickHandler);
- return () => document.removeEventListener("click", clickHandler);
+ return () => { document.removeEventListener("click", clickHandler); };
});
// close the mobile menu if the esc key is pressed
@@ -42,7 +42,7 @@ const MobileMenu: React.FC = ({ starsCount }) => {
setMobileNavOpen(false);
};
document.addEventListener("keydown", keyHandler);
- return () => document.removeEventListener("keydown", keyHandler);
+ return () => { document.removeEventListener("keydown", keyHandler); };
});
return (
@@ -53,7 +53,7 @@ const MobileMenu: React.FC = ({ starsCount }) => {
className={`hamburger ${mobileNavOpen && "active"}`}
aria-controls="mobile-nav"
aria-expanded={mobileNavOpen}
- onClick={() => setMobileNavOpen(!mobileNavOpen)}
+ onClick={() => { setMobileNavOpen(!mobileNavOpen); }}
>
Menu
= ({ starsCount }) => {
setShowResourcesDropdown(!showResourcesDropdown)}
+ onClick={() => { setShowResourcesDropdown(!showResourcesDropdown); }}
className="font-medium text-gray-600 hover:text-primary-300 px-5 py-3 flex items-center transition duration-150 ease-in-out"
>
Resources
diff --git a/components/utils/accordion.tsx b/components/utils/accordion.tsx
index 4e574bda..20b72d12 100644
--- a/components/utils/accordion.tsx
+++ b/components/utils/accordion.tsx
@@ -2,7 +2,7 @@
import { useState, useRef, useEffect } from 'react'
-type AccordionpProps = {
+interface AccordionpProps {
children: React.ReactNode
tag?: string
title: string
diff --git a/components/utils/countingNumbers.tsx b/components/utils/countingNumbers.tsx
index 0d753fd3..77993c8d 100644
--- a/components/utils/countingNumbers.tsx
+++ b/components/utils/countingNumbers.tsx
@@ -35,7 +35,7 @@ export default function CountingNumbers({
useEffect(() => {
scrollHandler();
window.addEventListener("scroll", scrollHandler);
- return () => window.removeEventListener("scroll", scrollHandler);
+ return () => { window.removeEventListener("scroll", scrollHandler); };
}, [top]);
let value: number;
@@ -71,7 +71,7 @@ export default function CountingNumbers({
useEffect(() => {
if (isInView) {
- let timer = setInterval(() => {
+ const timer = setInterval(() => {
if (reverse) {
if (number > starsCount) {
setNumber((num) => {
diff --git a/components/utils/dropdown.tsx b/components/utils/dropdown.tsx
index cabd5578..21d659cf 100644
--- a/components/utils/dropdown.tsx
+++ b/components/utils/dropdown.tsx
@@ -4,7 +4,7 @@ import { useState } from 'react'
import { Transition } from '@headlessui/react'
import Link from 'next/link'
-type DropdownProps = {
+interface DropdownProps {
children: React.ReactNode
title: string
}
@@ -19,16 +19,16 @@ export default function Dropdown({
return (
setDropdownOpen(true)}
- onMouseLeave={() => setDropdownOpen(false)}
- onFocus={() => setDropdownOpen(true)}
- onBlur={() => setDropdownOpen(false)}
+ onMouseEnter={() => { setDropdownOpen(true); }}
+ onMouseLeave={() => { setDropdownOpen(false); }}
+ onFocus={() => { setDropdownOpen(true); }}
+ onBlur={() => { setDropdownOpen(false); }}
>
e.preventDefault()}
+ onClick={(e) => { e.preventDefault(); }}
>
{title}
diff --git a/components/waitlistForm.tsx b/components/waitlistForm.tsx
index d53886ab..fee04512 100644
--- a/components/waitlistForm.tsx
+++ b/components/waitlistForm.tsx
@@ -14,7 +14,7 @@ interface FormData {
dependencies: string;
}
interface FormProps {
- isOpen: Boolean;
+ isOpen: boolean;
onClose: () => void;
}
export default function CustomForm({ isOpen, onClose }: FormProps) {
@@ -63,7 +63,7 @@ export default function CustomForm({ isOpen, onClose }: FormProps) {
setEmailError("Please enter a valid email address.");
setTimeout(() => {
- return setEmailError("");
+ setEmailError("");
}, 2000);
return;
}
@@ -84,7 +84,7 @@ export default function CustomForm({ isOpen, onClose }: FormProps) {
setLoading(false);
setSuccess(true)
})
- .catch((err) => console.log(err));
+ .catch((err) => { console.log(err); });
};
const isSubmitDisabled = (): boolean => {
@@ -109,7 +109,7 @@ export default function CustomForm({ isOpen, onClose }: FormProps) {
{!success ? (
);
-};
+}
diff --git a/components/webstories/components/Heading.tsx b/components/webstories/components/Heading.tsx
new file mode 100644
index 00000000..32806027
--- /dev/null
+++ b/components/webstories/components/Heading.tsx
@@ -0,0 +1,4 @@
+interface headingType { content: string; className: string }
+export const Heading = ({ content, className }: headingType) => {
+ return {content}
;
+};
diff --git a/components/webstories/components/SearchBar.tsx b/components/webstories/components/SearchBar.tsx
index bf7a0a19..1d72fd90 100644
--- a/components/webstories/components/SearchBar.tsx
+++ b/components/webstories/components/SearchBar.tsx
@@ -1,8 +1,8 @@
import React from "react";
-type SearchBarProps = {
+interface SearchBarProps {
onChange: (event: React.ChangeEvent) => void;
-};
+}
const SearchBar = ({ onChange }: SearchBarProps) => {
return (
diff --git a/components/webstories/components/ShareComponent.tsx b/components/webstories/components/ShareComponent.tsx
index 12f35695..25c85f77 100644
--- a/components/webstories/components/ShareComponent.tsx
+++ b/components/webstories/components/ShareComponent.tsx
@@ -37,7 +37,7 @@ export default function CustomizedDialogs({handlingPauseBehindScenes}:{handlingP
};
const handleClick = () => {
- navigator.clipboard.writeText(`${window.location.href}`).catch((error) => {
+ navigator.clipboard.writeText(window.location.href).catch((error) => {
alert(`Not able to copy the code due to ${error}`);
});
setOpenSnackBar(true);
@@ -84,9 +84,9 @@ export default function CustomizedDialogs({handlingPauseBehindScenes}:{handlingP
React.useEffect(() => {
if (typeof window !== "undefined") {
setWindowWidth(window.innerWidth);
- const handleResize = () => setWindowWidth(window.innerWidth);
+ const handleResize = () => { setWindowWidth(window.innerWidth); };
window.addEventListener("resize", handleResize);
- return () => window.removeEventListener("resize", handleResize);
+ return () => { window.removeEventListener("resize", handleResize); };
}
}, []);
diff --git a/components/webstories/components/circularLoader.tsx b/components/webstories/components/circularLoader.tsx
index 04485ce6..9e9962f3 100644
--- a/components/webstories/components/circularLoader.tsx
+++ b/components/webstories/components/circularLoader.tsx
@@ -40,7 +40,7 @@ const CircularLoader = ({ slug }: { slug: string | string[] }) => {
}
}, intervalDuration);
- return () => clearInterval(interval);
+ return () => { clearInterval(interval); };
}, []);
useEffect(() => {
@@ -50,7 +50,7 @@ const CircularLoader = ({ slug }: { slug: string | string[] }) => {
window.location.href = `/webstories/${nextIndexSlug}`;
}, 1000);
- return () => clearTimeout(redirectTimeout);
+ return () => { clearTimeout(redirectTimeout); };
}
}, [completed, nextIndexSlug]);