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">
|
<div className="flex justify-between items-center gap-5">
|
||||||
<p>Showing {activeCollection?._count?.links} results</p>
|
<p>Showing {activeCollection?._count?.links} results</p>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
{links.length > 0 && (
|
{links.length > 0 && (permissions === true || permissions?.canUpdate || permissions?.canDelete) && (
|
||||||
<div
|
<div
|
||||||
role="button"
|
role="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
|
@ -81,7 +81,7 @@ export default function Links() {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="mt-2 flex items-center justify-end gap-2">
|
<div className="mt-2 flex items-center justify-end gap-2">
|
||||||
{links.length > 0 && (
|
{links.length > 0 && (collectivePermissions === true || collectivePermissions?.canUpdate || collectivePermissions?.canDelete) && (
|
||||||
<div
|
<div
|
||||||
role="button"
|
role="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
|
@ -80,7 +80,7 @@ export default function PinnedLinks() {
|
||||||
description={"Pinned Links from your Collections"}
|
description={"Pinned Links from your Collections"}
|
||||||
/>
|
/>
|
||||||
<div className="mt-2 flex items-center justify-end gap-2">
|
<div className="mt-2 flex items-center justify-end gap-2">
|
||||||
{!(links.length === 0) && (
|
{links.length > 0 && (collectivePermissions === true || collectivePermissions?.canUpdate || collectivePermissions?.canDelete) && (
|
||||||
<div
|
<div
|
||||||
role="button"
|
role="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
|
@ -239,6 +239,7 @@ export default function Index() {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex gap-2 items-center mt-2">
|
<div className="flex gap-2 items-center mt-2">
|
||||||
|
{links.length > 0 && (collectivePermissions === true || collectivePermissions?.canUpdate || collectivePermissions?.canDelete) && (
|
||||||
<div
|
<div
|
||||||
role="button"
|
role="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -252,6 +253,7 @@ export default function Index() {
|
||||||
>
|
>
|
||||||
<i className="bi-pencil-fill text-neutral text-xl"></i>
|
<i className="bi-pencil-fill text-neutral text-xl"></i>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
<SortDropdown sortBy={sortBy} setSort={setSortBy} />
|
<SortDropdown sortBy={sortBy} setSort={setSortBy} />
|
||||||
<ViewDropdown viewMode={viewMode} setViewMode={setViewMode} />
|
<ViewDropdown viewMode={viewMode} setViewMode={setViewMode} />
|
||||||
</div>
|
</div>
|
||||||
|
|
Ŝarĝante…
Reference in New Issue