Merge branch 'issue-433' of https://github.com/isaacwise06/linkwarden into issue-433
This commit is contained in:
commit
8f62f4dffb
|
@ -70,7 +70,7 @@ export default function LinkCard({
|
|||
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const isVisible = useOnScreen(ref);
|
||||
const permissions = usePermissions(collection.id as number);
|
||||
const permissions = usePermissions(collection?.id as number);
|
||||
|
||||
useEffect(() => {
|
||||
let interval: any;
|
||||
|
|
|
@ -64,7 +64,7 @@ export default function LinkCardCompact({
|
|||
);
|
||||
}, [collections, links]);
|
||||
|
||||
const permissions = usePermissions(collection.id as number);
|
||||
const permissions = usePermissions(collection?.id as number);
|
||||
|
||||
const [showInfo, setShowInfo] = useState(false);
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ export default function Index() {
|
|||
useState<CollectionIncludingMembersAndLinkCount>();
|
||||
|
||||
const permissions = usePermissions(activeCollection?.id as number);
|
||||
console.log(permissions)
|
||||
|
||||
useLinks({ collectionId: Number(router.query.id), sort: sortBy });
|
||||
|
||||
|
@ -307,19 +306,21 @@ export default function Index() {
|
|||
</div>
|
||||
|
||||
<div className="w-full flex justify-between items-center min-h-[32px]">
|
||||
<div className="flex gap-3 ml-3">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="checkbox checkbox-primary"
|
||||
onChange={() => handleSelectAll()}
|
||||
checked={selectedLinks.length === links.length && links.length > 0}
|
||||
/>
|
||||
{selectedLinks.length > 0 && (
|
||||
<span>
|
||||
{selectedLinks.length} {selectedLinks.length === 1 ? 'link' : 'links'} selected
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{links.length > 0 && (
|
||||
<div className="flex gap-3 ml-3">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="checkbox checkbox-primary"
|
||||
onChange={() => handleSelectAll()}
|
||||
checked={selectedLinks.length === links.length && links.length > 0}
|
||||
/>
|
||||
{selectedLinks.length > 0 && (
|
||||
<span>
|
||||
{selectedLinks.length} {selectedLinks.length === 1 ? 'link' : 'links'} selected
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className="flex gap-3">
|
||||
{selectedLinks.length > 0 && (permissions === true || permissions?.canUpdate) &&
|
||||
<button onClick={() => setBulkEditLinksModal(true)} className="btn btn-sm btn-accent dark:border-violet-400 text-white w-fit ml-auto">
|
||||
|
|
|
@ -145,11 +145,10 @@ export default function Index() {
|
|||
</p>
|
||||
<div className="relative">
|
||||
<div
|
||||
className={`dropdown dropdown-bottom font-normal ${
|
||||
activeTag?.name.length && activeTag?.name.length > 8
|
||||
className={`dropdown dropdown-bottom font-normal ${activeTag?.name.length && activeTag?.name.length > 8
|
||||
? "dropdown-end"
|
||||
: ""
|
||||
}`}
|
||||
}`}
|
||||
>
|
||||
<div
|
||||
tabIndex={0}
|
||||
|
@ -200,6 +199,7 @@ export default function Index() {
|
|||
</div>
|
||||
</div>
|
||||
<LinkComponent
|
||||
showCheckbox={false}
|
||||
links={links.filter((e) =>
|
||||
e.tags.some((e) => e.id === Number(router.query.id))
|
||||
)}
|
||||
|
|
Ŝarĝante…
Reference in New Issue