Remove type assertions
This commit is contained in:
parent
d631754b50
commit
8f7e0b8d09
|
@ -15,12 +15,11 @@ import DeleteCollectionModal from "./ModalContent/DeleteCollectionModal";
|
||||||
import { dropdownTriggerer } from "@/lib/client/utils";
|
import { dropdownTriggerer } from "@/lib/client/utils";
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
|
|
||||||
type Props = {
|
export default function CollectionCard({
|
||||||
|
collection,
|
||||||
|
}: {
|
||||||
collection: CollectionIncludingMembersAndLinkCount;
|
collection: CollectionIncludingMembersAndLinkCount;
|
||||||
className?: string;
|
}) {
|
||||||
};
|
|
||||||
|
|
||||||
export default function CollectionCard({ collection, className }: Props) {
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { settings } = useLocalSettingsStore();
|
const { settings } = useLocalSettingsStore();
|
||||||
const { account } = useAccountStore();
|
const { account } = useAccountStore();
|
||||||
|
@ -49,11 +48,11 @@ export default function CollectionCard({ collection, className }: Props) {
|
||||||
setCollectionOwner({
|
setCollectionOwner({
|
||||||
id: account.id as number,
|
id: account.id as number,
|
||||||
name: account.name,
|
name: account.name,
|
||||||
username: account.username as string,
|
username: account.username,
|
||||||
image: account.image as string,
|
image: account.image,
|
||||||
archiveAsScreenshot: account.archiveAsScreenshot as boolean,
|
archiveAsScreenshot: account.archiveAsScreenshot,
|
||||||
archiveAsMonolith: account.archiveAsMonolith as boolean,
|
archiveAsMonolith: account.archiveAsMonolith,
|
||||||
archiveAsPDF: account.archiveAsPDF as boolean,
|
archiveAsPDF: account.archiveAsPDF,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,11 +10,11 @@ type Props = {
|
||||||
onChange: any;
|
onChange: any;
|
||||||
showDefaultValue?: boolean;
|
showDefaultValue?: boolean;
|
||||||
defaultValue?:
|
defaultValue?:
|
||||||
| {
|
| {
|
||||||
label: string;
|
label: string;
|
||||||
value?: number;
|
value?: number;
|
||||||
}
|
}
|
||||||
| undefined;
|
| undefined;
|
||||||
creatable?: boolean;
|
creatable?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ export default function CollectionSelection({
|
||||||
components={{
|
components={{
|
||||||
Option: customOption,
|
Option: customOption,
|
||||||
}}
|
}}
|
||||||
// menuPosition="fixed"
|
// menuPosition="fixed"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -123,7 +123,7 @@ export default function CollectionSelection({
|
||||||
components={{
|
components={{
|
||||||
Option: customOption,
|
Option: customOption,
|
||||||
}}
|
}}
|
||||||
// menuPosition="fixed"
|
// menuPosition="fixed"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,13 +51,13 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {
|
||||||
setCollectionOwner(owner);
|
setCollectionOwner(owner);
|
||||||
} else if (link.collection.ownerId === account.id) {
|
} else if (link.collection.ownerId === account.id) {
|
||||||
setCollectionOwner({
|
setCollectionOwner({
|
||||||
id: account.id as number,
|
id: account.id,
|
||||||
name: account.name,
|
name: account.name,
|
||||||
username: account.username as string,
|
username: account.username,
|
||||||
image: account.image as string,
|
image: account.image,
|
||||||
archiveAsScreenshot: account.archiveAsScreenshot as boolean,
|
archiveAsScreenshot: account.archiveAsScreenshot,
|
||||||
archiveAsMonolith: account.archiveAsScreenshot as boolean,
|
archiveAsMonolith: account.archiveAsScreenshot,
|
||||||
archiveAsPDF: account.archiveAsPDF as boolean,
|
archiveAsPDF: account.archiveAsPDF,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { useEffect, useState } from "react";
|
||||||
|
|
||||||
export default function useCollectivePermissions(collectionIds: number[]) {
|
export default function useCollectivePermissions(collectionIds: number[]) {
|
||||||
const { collections } = useCollectionStore();
|
const { collections } = useCollectionStore();
|
||||||
|
|
||||||
const { account } = useAccountStore();
|
const { account } = useAccountStore();
|
||||||
|
|
||||||
const [permissions, setPermissions] = useState<Member | true>();
|
const [permissions, setPermissions] = useState<Member | true>();
|
||||||
|
|
|
@ -69,11 +69,11 @@ export default function Index() {
|
||||||
setCollectionOwner({
|
setCollectionOwner({
|
||||||
id: account.id as number,
|
id: account.id as number,
|
||||||
name: account.name,
|
name: account.name,
|
||||||
username: account.username as string,
|
username: account.username,
|
||||||
image: account.image as string,
|
image: account.image,
|
||||||
archiveAsScreenshot: account.archiveAsScreenshot as boolean,
|
archiveAsScreenshot: account.archiveAsScreenshot,
|
||||||
archiveAsMonolith: account.archiveAsScreenshot as boolean,
|
archiveAsMonolith: account.archiveAsScreenshot,
|
||||||
archiveAsPDF: account.archiveAsPDF as boolean,
|
archiveAsPDF: account.archiveAsPDF,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Ŝarĝante…
Reference in New Issue