Only show edit icon if there are links

This commit is contained in:
Isaac Wise 2024-02-11 01:08:28 -06:00
parent 5f468cd95d
commit 0c531760e8
3 changed files with 45 additions and 39 deletions

View File

@ -308,6 +308,7 @@ export default function Index() {
<div className="flex justify-between items-center gap-5">
<p>Showing {activeCollection?._count?.links} results</p>
<div className="flex items-center gap-2">
{links.length > 0 && (
<div
role="button"
onClick={() => {
@ -321,6 +322,7 @@ export default function Index() {
>
<i className="bi-pencil-fill text-neutral text-xl"></i>
</div>
)}
<SortDropdown sortBy={sortBy} setSort={setSortBy} />
<ViewDropdown viewMode={viewMode} setViewMode={setViewMode} />
</div>

View File

@ -78,6 +78,7 @@ export default function Links() {
/>
<div className="mt-2 flex items-center justify-end gap-2">
{links.length > 0 && (
<div
role="button"
onClick={() => {
@ -91,6 +92,7 @@ export default function Links() {
>
<i className="bi-pencil-fill text-neutral text-xl"></i>
</div>
)}
<SortDropdown sortBy={sortBy} setSort={setSortBy} />
<ViewDropdown viewMode={viewMode} setViewMode={setViewMode} />
</div>

View File

@ -77,6 +77,7 @@ export default function PinnedLinks() {
description={"Pinned Links from your Collections"}
/>
<div className="mt-2 flex items-center justify-end gap-2">
{links.length > 0 && (
<div
role="button"
onClick={() => {
@ -90,6 +91,7 @@ export default function PinnedLinks() {
>
<i className="bi-pencil-fill text-neutral text-xl"></i>
</div>
)}
<SortDropdown sortBy={sortBy} setSort={setSortBy} />
<ViewDropdown viewMode={viewMode} setViewMode={setViewMode} />
</div>