added cursor based pagination for links
This commit is contained in:
+6
-5
@@ -12,6 +12,7 @@ import Link from "next/link";
|
||||
import CollectionCard from "@/components/CollectionCard";
|
||||
import { Disclosure, Transition } from "@headlessui/react";
|
||||
import { useEffect, useState } from "react";
|
||||
import useLinks from "@/hooks/useLinks";
|
||||
|
||||
export default function Dashboard() {
|
||||
const { collections } = useCollectionStore();
|
||||
@@ -34,6 +35,8 @@ export default function Dashboard() {
|
||||
return storedValue ? storedValue === "true" : true;
|
||||
});
|
||||
|
||||
useLinks({ pinnedOnly: true });
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem(
|
||||
"tagPinDisclosure",
|
||||
@@ -131,11 +134,9 @@ export default function Dashboard() {
|
||||
leaveTo="transform opacity-0 -translate-y-3"
|
||||
>
|
||||
<Disclosure.Panel className="flex flex-col gap-5 w-full">
|
||||
{links
|
||||
.filter((e) => e.pinnedBy && e.pinnedBy[0])
|
||||
.map((e, i) => (
|
||||
<LinkCard key={i} link={e} count={i} />
|
||||
))}
|
||||
{links.map((e, i) => (
|
||||
<LinkCard key={i} link={e} count={i} />
|
||||
))}
|
||||
</Disclosure.Panel>
|
||||
</Transition>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user