format
This commit is contained in:
@@ -3,7 +3,7 @@ import { LinkIncludingShortenedCollectionAndTags } from "@/types/global";
|
||||
|
||||
export default function ListView({
|
||||
links,
|
||||
showCheckbox = true
|
||||
showCheckbox = true,
|
||||
}: {
|
||||
links: LinkIncludingShortenedCollectionAndTags[];
|
||||
showCheckbox?: boolean;
|
||||
|
||||
@@ -37,7 +37,9 @@ export default function LinkCard({
|
||||
|
||||
const { links, getLink, setSelectedLinks, selectedLinks } = useLinkStore();
|
||||
|
||||
const handleCheckboxClick = (link: LinkIncludingShortenedCollectionAndTags) => {
|
||||
const handleCheckboxClick = (
|
||||
link: LinkIncludingShortenedCollectionAndTags
|
||||
) => {
|
||||
if (selectedLinks.includes(link)) {
|
||||
setSelectedLinks(selectedLinks.filter((e) => e !== link));
|
||||
} else {
|
||||
@@ -99,14 +101,17 @@ export default function LinkCard({
|
||||
ref={ref}
|
||||
className="border border-solid border-neutral-content bg-base-200 shadow-md hover:shadow-none duration-100 rounded-2xl relative"
|
||||
>
|
||||
{showCheckbox && (permissions === true || permissions?.canCreate || permissions?.canDelete) &&
|
||||
<input
|
||||
type="checkbox"
|
||||
className="checkbox checkbox-primary my-auto ml-3 mt-3 absolute z-20 bg-white dark:bg-base-200"
|
||||
checked={selectedLinks.includes(link)}
|
||||
onChange={() => handleCheckboxClick(link)}
|
||||
/>
|
||||
}
|
||||
{showCheckbox &&
|
||||
(permissions === true ||
|
||||
permissions?.canCreate ||
|
||||
permissions?.canDelete) && (
|
||||
<input
|
||||
type="checkbox"
|
||||
className="checkbox checkbox-primary my-auto ml-3 mt-3 absolute z-20 bg-white dark:bg-base-200"
|
||||
checked={selectedLinks.includes(link)}
|
||||
onChange={() => handleCheckboxClick(link)}
|
||||
/>
|
||||
)}
|
||||
<Link
|
||||
href={generateLinkHref(link, account)}
|
||||
target="_blank"
|
||||
|
||||
@@ -101,7 +101,7 @@ export default function LinkGrid({ link }: Props) {
|
||||
</div>
|
||||
|
||||
<LinkActions
|
||||
toggleShowInfo={() => { }}
|
||||
toggleShowInfo={() => {}}
|
||||
linkInfo={false}
|
||||
link={link}
|
||||
collection={collection}
|
||||
|
||||
@@ -33,7 +33,9 @@ export default function LinkCardCompact({
|
||||
const { account } = useAccountStore();
|
||||
const { links, setSelectedLinks, selectedLinks } = useLinkStore();
|
||||
|
||||
const handleCheckboxClick = (link: LinkIncludingShortenedCollectionAndTags) => {
|
||||
const handleCheckboxClick = (
|
||||
link: LinkIncludingShortenedCollectionAndTags
|
||||
) => {
|
||||
if (selectedLinks.includes(link)) {
|
||||
setSelectedLinks(selectedLinks.filter((e) => e !== link));
|
||||
} else {
|
||||
@@ -71,17 +73,21 @@ export default function LinkCardCompact({
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={`border-neutral-content relative items-center flex ${!showInfo && !isPWA() ? "hover:bg-base-300 p-3" : "py-3"
|
||||
} duration-200 rounded-lg`}
|
||||
className={`border-neutral-content relative items-center flex ${
|
||||
!showInfo && !isPWA() ? "hover:bg-base-300 p-3" : "py-3"
|
||||
} duration-200 rounded-lg`}
|
||||
>
|
||||
{showCheckbox && (permissions === true || permissions?.canCreate || permissions?.canDelete) &&
|
||||
<input
|
||||
type="checkbox"
|
||||
className="checkbox checkbox-primary my-auto mr-2"
|
||||
checked={selectedLinks.includes(link)}
|
||||
onChange={() => handleCheckboxClick(link)}
|
||||
/>
|
||||
}
|
||||
{showCheckbox &&
|
||||
(permissions === true ||
|
||||
permissions?.canCreate ||
|
||||
permissions?.canDelete) && (
|
||||
<input
|
||||
type="checkbox"
|
||||
className="checkbox checkbox-primary my-auto mr-2"
|
||||
checked={selectedLinks.includes(link)}
|
||||
onChange={() => handleCheckboxClick(link)}
|
||||
/>
|
||||
)}
|
||||
<Link
|
||||
href={generateLinkHref(link, account)}
|
||||
target="_blank"
|
||||
@@ -122,8 +128,8 @@ export default function LinkCardCompact({
|
||||
collection={collection}
|
||||
position="top-3 right-3"
|
||||
flipDropdown={flipDropdown}
|
||||
// toggleShowInfo={() => setShowInfo(!showInfo)}
|
||||
// linkInfo={showInfo}
|
||||
// toggleShowInfo={() => setShowInfo(!showInfo)}
|
||||
// linkInfo={showInfo}
|
||||
/>
|
||||
{showInfo ? (
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user