Don't show the edit button if the user can't edit/delete any links
This commit is contained in:
parent
1cff2db876
commit
a3c487d074
|
@ -309,7 +309,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 && (
|
||||
{links.length > 0 && (permissions === true || permissions?.canUpdate || permissions?.canDelete) && (
|
||||
<div
|
||||
role="button"
|
||||
onClick={() => {
|
||||
|
|
|
@ -81,7 +81,7 @@ export default function Links() {
|
|||
/>
|
||||
|
||||
<div className="mt-2 flex items-center justify-end gap-2">
|
||||
{links.length > 0 && (
|
||||
{links.length > 0 && (collectivePermissions === true || collectivePermissions?.canUpdate || collectivePermissions?.canDelete) && (
|
||||
<div
|
||||
role="button"
|
||||
onClick={() => {
|
||||
|
|
|
@ -80,7 +80,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) && (
|
||||
{links.length > 0 && (collectivePermissions === true || collectivePermissions?.canUpdate || collectivePermissions?.canDelete) && (
|
||||
<div
|
||||
role="button"
|
||||
onClick={() => {
|
||||
|
|
|
@ -239,6 +239,7 @@ export default function Index() {
|
|||
</div>
|
||||
|
||||
<div className="flex gap-2 items-center mt-2">
|
||||
{links.length > 0 && (collectivePermissions === true || collectivePermissions?.canUpdate || collectivePermissions?.canDelete) && (
|
||||
<div
|
||||
role="button"
|
||||
onClick={() => {
|
||||
|
@ -252,6 +253,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>
|
||||
|
|
Ŝarĝante…
Reference in New Issue