bug fix + cleaner code/logic

This commit is contained in:
Daniel
2023-06-15 16:09:30 +03:30
parent 1b6d902c75
commit 4b9b1be80c
11 changed files with 156 additions and 229 deletions
+6 -4
View File
@@ -35,7 +35,7 @@ export default function Dashboard() {
return storedValue ? storedValue === "true" : true;
});
useLinks({ pinnedOnly: true });
useLinks({ pinnedOnly: true, sort: 0 });
useEffect(() => {
localStorage.setItem(
@@ -134,9 +134,11 @@ export default function Dashboard() {
leaveTo="transform opacity-0 -translate-y-3"
>
<Disclosure.Panel className="flex flex-col gap-5 w-full">
{links.map((e, i) => (
<LinkCard key={i} link={e} count={i} />
))}
{links
.filter((e) => e.pinnedBy)
.map((e, i) => (
<LinkCard key={i} link={e} count={i} />
))}
</Disclosure.Panel>
</Transition>
</div>