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 ref = useRef<HTMLDivElement>(null);
|
||||||
const isVisible = useOnScreen(ref);
|
const isVisible = useOnScreen(ref);
|
||||||
const permissions = usePermissions(collection.id as number);
|
const permissions = usePermissions(collection?.id as number);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let interval: any;
|
let interval: any;
|
||||||
|
|
|
@ -64,7 +64,7 @@ export default function LinkCardCompact({
|
||||||
);
|
);
|
||||||
}, [collections, links]);
|
}, [collections, links]);
|
||||||
|
|
||||||
const permissions = usePermissions(collection.id as number);
|
const permissions = usePermissions(collection?.id as number);
|
||||||
|
|
||||||
const [showInfo, setShowInfo] = useState(false);
|
const [showInfo, setShowInfo] = useState(false);
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,6 @@ export default function Index() {
|
||||||
useState<CollectionIncludingMembersAndLinkCount>();
|
useState<CollectionIncludingMembersAndLinkCount>();
|
||||||
|
|
||||||
const permissions = usePermissions(activeCollection?.id as number);
|
const permissions = usePermissions(activeCollection?.id as number);
|
||||||
console.log(permissions)
|
|
||||||
|
|
||||||
useLinks({ collectionId: Number(router.query.id), sort: sortBy });
|
useLinks({ collectionId: Number(router.query.id), sort: sortBy });
|
||||||
|
|
||||||
|
@ -307,19 +306,21 @@ export default function Index() {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-full flex justify-between items-center min-h-[32px]">
|
<div className="w-full flex justify-between items-center min-h-[32px]">
|
||||||
<div className="flex gap-3 ml-3">
|
{links.length > 0 && (
|
||||||
<input
|
<div className="flex gap-3 ml-3">
|
||||||
type="checkbox"
|
<input
|
||||||
className="checkbox checkbox-primary"
|
type="checkbox"
|
||||||
onChange={() => handleSelectAll()}
|
className="checkbox checkbox-primary"
|
||||||
checked={selectedLinks.length === links.length && links.length > 0}
|
onChange={() => handleSelectAll()}
|
||||||
/>
|
checked={selectedLinks.length === links.length && links.length > 0}
|
||||||
{selectedLinks.length > 0 && (
|
/>
|
||||||
<span>
|
{selectedLinks.length > 0 && (
|
||||||
{selectedLinks.length} {selectedLinks.length === 1 ? 'link' : 'links'} selected
|
<span>
|
||||||
</span>
|
{selectedLinks.length} {selectedLinks.length === 1 ? 'link' : 'links'} selected
|
||||||
)}
|
</span>
|
||||||
</div>
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className="flex gap-3">
|
<div className="flex gap-3">
|
||||||
{selectedLinks.length > 0 && (permissions === true || permissions?.canUpdate) &&
|
{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">
|
<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>
|
</p>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<div
|
<div
|
||||||
className={`dropdown dropdown-bottom font-normal ${
|
className={`dropdown dropdown-bottom font-normal ${activeTag?.name.length && activeTag?.name.length > 8
|
||||||
activeTag?.name.length && activeTag?.name.length > 8
|
|
||||||
? "dropdown-end"
|
? "dropdown-end"
|
||||||
: ""
|
: ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
|
@ -200,6 +199,7 @@ export default function Index() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<LinkComponent
|
<LinkComponent
|
||||||
|
showCheckbox={false}
|
||||||
links={links.filter((e) =>
|
links={links.filter((e) =>
|
||||||
e.tags.some((e) => e.id === Number(router.query.id))
|
e.tags.some((e) => e.id === Number(router.query.id))
|
||||||
)}
|
)}
|
||||||
|
|
Ŝarĝante…
Reference in New Issue