fixes + improvements
This commit is contained in:
parent
36778810c5
commit
632548e54a
|
@ -21,13 +21,12 @@ import Link from "next/link";
|
||||||
import Dropdown from "../Dropdown";
|
import Dropdown from "../Dropdown";
|
||||||
import Modal from "../Modal";
|
import Modal from "../Modal";
|
||||||
|
|
||||||
export default function ({
|
type Props = {
|
||||||
link,
|
|
||||||
count,
|
|
||||||
}: {
|
|
||||||
link: LinkIncludingCollectionAndTags;
|
link: LinkIncludingCollectionAndTags;
|
||||||
count: number;
|
count: number;
|
||||||
}) {
|
};
|
||||||
|
|
||||||
|
export default function ({ link, count }: Props) {
|
||||||
const [expandDropdown, setExpandDropdown] = useState(false);
|
const [expandDropdown, setExpandDropdown] = useState(false);
|
||||||
const [editModal, setEditModal] = useState(false);
|
const [editModal, setEditModal] = useState(false);
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,12 @@ import Modal from "./Modal";
|
||||||
import EditLink from "./Modal/EditLink";
|
import EditLink from "./Modal/EditLink";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
export default function ({
|
type Props = {
|
||||||
link,
|
|
||||||
count,
|
|
||||||
}: {
|
|
||||||
link: LinkIncludingCollectionAndTags;
|
link: LinkIncludingCollectionAndTags;
|
||||||
count: number;
|
count: number;
|
||||||
}) {
|
};
|
||||||
|
|
||||||
|
export default function ({ link, count }: Props) {
|
||||||
const [expandDropdown, setExpandDropdown] = useState(false);
|
const [expandDropdown, setExpandDropdown] = useState(false);
|
||||||
const [editModal, setEditModal] = useState(false);
|
const [editModal, setEditModal] = useState(false);
|
||||||
|
|
||||||
|
|
|
@ -89,14 +89,16 @@ export default function () {
|
||||||
setSortedLinks(
|
setSortedLinks(
|
||||||
linksArray.sort(
|
linksArray.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
|
new Date(b.createdAt as string).getTime() -
|
||||||
|
new Date(a.createdAt as string).getTime()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
else if (sortBy === "Date (Oldest First)")
|
else if (sortBy === "Date (Oldest First)")
|
||||||
setSortedLinks(
|
setSortedLinks(
|
||||||
linksArray.sort(
|
linksArray.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime()
|
new Date(a.createdAt as string).getTime() -
|
||||||
|
new Date(b.createdAt as string).getTime()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}, [links, router, collections, sortBy]);
|
}, [links, router, collections, sortBy]);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import { Collection, Link, Tag, User } from "@prisma/client";
|
import { Collection, Link, Tag, User } from "@prisma/client";
|
||||||
|
|
||||||
export type OptionalExcluding<T, TRequired extends keyof T> = Partial<T> &
|
type OptionalExcluding<T, TRequired extends keyof T> = Partial<T> &
|
||||||
Pick<T, TRequired>;
|
Pick<T, TRequired>;
|
||||||
|
|
||||||
export interface LinkIncludingCollectionAndTags
|
export interface LinkIncludingCollectionAndTags
|
||||||
|
@ -33,6 +33,12 @@ export interface CollectionIncludingMembers
|
||||||
members: Member[];
|
members: Member[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface AccountSettings extends User {
|
||||||
|
profilePic: string | null;
|
||||||
|
oldPassword?: string;
|
||||||
|
newPassword?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export type SearchSettings = {
|
export type SearchSettings = {
|
||||||
query: string;
|
query: string;
|
||||||
filter: {
|
filter: {
|
||||||
|
@ -43,9 +49,3 @@ export type SearchSettings = {
|
||||||
tags: boolean;
|
tags: boolean;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface AccountSettings extends User {
|
|
||||||
profilePic: string | null;
|
|
||||||
oldPassword?: string;
|
|
||||||
newPassword?: string;
|
|
||||||
}
|
|
||||||
|
|
Ŝarĝante…
Reference in New Issue