Fix some any types

This commit is contained in:
Isaac Wise
2024-07-25 18:58:52 -05:00
parent e79b98d3b0
commit 0b8a9b4310
16 changed files with 49 additions and 55 deletions
+2 -2
View File
@@ -232,8 +232,8 @@ const renderItem = (
<div ref={provided.innerRef} {...provided.draggableProps} className="mb-1">
<div
className={`${currentPath === `/collections/${collection.id}`
? "bg-primary/20 is-active"
: "hover:bg-neutral/20"
? "bg-primary/20 is-active"
: "hover:bg-neutral/20"
} duration-100 flex gap-1 items-center pr-2 pl-1 rounded-md`}
>
{Icon(item as ExtendedTreeItem, onExpand, onCollapse)}
@@ -4,17 +4,17 @@ import { useEffect, useState } from "react";
import { styles } from "./styles";
import { Options } from "./types";
import CreatableSelect from "react-select/creatable";
import Select from "react-select";
import Select, { ActionMeta } from "react-select";
type Props = {
onChange: any;
onChange: (newValue: unknown, actionMeta: ActionMeta<unknown>) => void;
showDefaultValue?: boolean;
defaultValue?:
| {
label: string;
value?: number;
}
| undefined;
| {
label: string;
value?: number;
}
| undefined;
creatable?: boolean;
};
@@ -107,7 +107,7 @@ export default function CollectionSelection({
components={{
Option: customOption,
}}
// menuPosition="fixed"
// menuPosition="fixed"
/>
);
} else {
@@ -123,7 +123,7 @@ export default function CollectionSelection({
components={{
Option: customOption,
}}
// menuPosition="fixed"
// menuPosition="fixed"
/>
);
}
+2 -1
View File
@@ -3,9 +3,10 @@ import { useEffect, useState } from "react";
import CreatableSelect from "react-select/creatable";
import { styles } from "./styles";
import { Options } from "./types";
import { ActionMeta } from "react-select";
type Props = {
onChange: any;
onChange: (newValue: unknown, actionMeta: ActionMeta<unknown>) => void;
defaultValue?: {
value: number;
label: string;
+1 -1
View File
@@ -85,7 +85,7 @@ export default function LinkCard({ link, flipDropdown, editMode }: Props) {
const permissions = usePermissions(collection?.id as number);
useEffect(() => {
let interval: any;
let interval: NodeJS.Timeout | null = null;
if (
isVisible &&
+1 -1
View File
@@ -84,7 +84,7 @@ export default function LinkMasonry({ link, flipDropdown, editMode }: Props) {
const permissions = usePermissions(collection?.id as number);
useEffect(() => {
let interval: any;
let interval: NodeJS.Timeout | null = null;
if (
isVisible &&
@@ -104,7 +104,7 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {
);
})();
let interval: any;
let interval: NodeJS.Timeout | null = null;
if (!isReady()) {
interval = setInterval(async () => {
+5 -12
View File
@@ -4,10 +4,8 @@ import {
ArchivedFormat,
LinkIncludingShortenedCollectionAndTags,
} from "@/types/global";
import toast from "react-hot-toast";
import Link from "next/link";
import { useRouter } from "next/router";
import { useSession } from "next-auth/react";
type Props = {
name: string;
@@ -24,7 +22,6 @@ export default function PreservedFormatRow({
activeLink,
downloadable,
}: Props) {
const session = useSession();
const { getLink } = useLinkStore();
const [link, setLink] =
@@ -36,19 +33,15 @@ export default function PreservedFormatRow({
useEffect(() => {
(async () => {
const data = await getLink(link.id as number, isPublic);
setLink(
(data as any).response as LinkIncludingShortenedCollectionAndTags
);
const { data } = await getLink(link.id as number, isPublic);
setLink(data as LinkIncludingShortenedCollectionAndTags);
})();
let interval: any;
let interval: NodeJS.Timeout | null = null;
if (link?.image === "pending" || link?.pdf === "pending") {
interval = setInterval(async () => {
const data = await getLink(link.id as number, isPublic);
setLink(
(data as any).response as LinkIncludingShortenedCollectionAndTags
);
const { data } = await getLink(link.id as number, isPublic);
setLink(data as LinkIncludingShortenedCollectionAndTags);
}, 5000);
} else {
if (interval) {
+1 -1
View File
@@ -75,7 +75,7 @@ export default function ReadableView({ link }: Props) {
useEffect(() => {
if (link) getLink(link?.id as number);
let interval: any;
let interval: NodeJS.Timeout | null = null;
if (
link &&
(link?.image === "pending" ||