Remove type assertions

This commit is contained in:
Isaac Wise 2024-07-27 20:01:51 -05:00
parent d631754b50
commit 8f7e0b8d09
No known key found for this signature in database
GPG Key ID: A02A33A7E2427136
5 changed files with 27 additions and 29 deletions

View File

@ -15,12 +15,11 @@ import DeleteCollectionModal from "./ModalContent/DeleteCollectionModal";
import { dropdownTriggerer } from "@/lib/client/utils";
import { useTranslation } from "next-i18next";
type Props = {
export default function CollectionCard({
collection,
}: {
collection: CollectionIncludingMembersAndLinkCount;
className?: string;
};
export default function CollectionCard({ collection, className }: Props) {
}) {
const { t } = useTranslation();
const { settings } = useLocalSettingsStore();
const { account } = useAccountStore();
@ -49,11 +48,11 @@ export default function CollectionCard({ collection, className }: Props) {
setCollectionOwner({
id: account.id as number,
name: account.name,
username: account.username as string,
image: account.image as string,
archiveAsScreenshot: account.archiveAsScreenshot as boolean,
archiveAsMonolith: account.archiveAsMonolith as boolean,
archiveAsPDF: account.archiveAsPDF as boolean,
username: account.username,
image: account.image,
archiveAsScreenshot: account.archiveAsScreenshot,
archiveAsMonolith: account.archiveAsMonolith,
archiveAsPDF: account.archiveAsPDF,
});
}
};

View File

@ -10,11 +10,11 @@ type Props = {
onChange: any;
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"
/>
);
}

View File

@ -51,13 +51,13 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {
setCollectionOwner(owner);
} else if (link.collection.ownerId === account.id) {
setCollectionOwner({
id: account.id as number,
id: account.id,
name: account.name,
username: account.username as string,
image: account.image as string,
archiveAsScreenshot: account.archiveAsScreenshot as boolean,
archiveAsMonolith: account.archiveAsScreenshot as boolean,
archiveAsPDF: account.archiveAsPDF as boolean,
username: account.username,
image: account.image,
archiveAsScreenshot: account.archiveAsScreenshot,
archiveAsMonolith: account.archiveAsScreenshot,
archiveAsPDF: account.archiveAsPDF,
});
}
};

View File

@ -5,7 +5,6 @@ import { useEffect, useState } from "react";
export default function useCollectivePermissions(collectionIds: number[]) {
const { collections } = useCollectionStore();
const { account } = useAccountStore();
const [permissions, setPermissions] = useState<Member | true>();

View File

@ -69,11 +69,11 @@ export default function Index() {
setCollectionOwner({
id: account.id as number,
name: account.name,
username: account.username as string,
image: account.image as string,
archiveAsScreenshot: account.archiveAsScreenshot as boolean,
archiveAsMonolith: account.archiveAsScreenshot as boolean,
archiveAsPDF: account.archiveAsPDF as boolean,
username: account.username,
image: account.image,
archiveAsScreenshot: account.archiveAsScreenshot,
archiveAsMonolith: account.archiveAsScreenshot,
archiveAsPDF: account.archiveAsPDF,
});
}
};