Don't show checkboxes on dashboard
This commit is contained in:
parent
eba9d3c86d
commit
193c66123b
|
@ -22,11 +22,13 @@ type Props = {
|
||||||
count: number;
|
count: number;
|
||||||
className?: string;
|
className?: string;
|
||||||
flipDropdown?: boolean;
|
flipDropdown?: boolean;
|
||||||
|
showCheckbox?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function LinkCard({
|
export default function LinkCard({
|
||||||
link,
|
link,
|
||||||
flipDropdown,
|
flipDropdown,
|
||||||
|
showCheckbox,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const { collections } = useCollectionStore();
|
const { collections } = useCollectionStore();
|
||||||
|
|
||||||
|
@ -89,12 +91,14 @@ export default function LinkCard({
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className="border border-solid border-neutral-content bg-base-200 shadow-md hover:shadow-none duration-100 rounded-2xl relative"
|
className="border border-solid border-neutral-content bg-base-200 shadow-md hover:shadow-none duration-100 rounded-2xl relative"
|
||||||
>
|
>
|
||||||
|
{showCheckbox &&
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
className="checkbox checkbox-primary my-auto ml-3 mt-3 fixed z-50 bg-white"
|
className="checkbox checkbox-primary my-auto ml-3 mt-3 absolute z-20 bg-white"
|
||||||
checked={selectedLinks.includes(link.id)}
|
checked={selectedLinks.includes(link.id)}
|
||||||
onChange={() => handleCheckboxClick(link.id)}
|
onChange={() => handleCheckboxClick(link.id)}
|
||||||
/>
|
/>
|
||||||
|
}
|
||||||
<Link
|
<Link
|
||||||
href={generateLinkHref(link)}
|
href={generateLinkHref(link)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
|
@ -19,11 +19,13 @@ type Props = {
|
||||||
count: number;
|
count: number;
|
||||||
className?: string;
|
className?: string;
|
||||||
flipDropdown?: boolean;
|
flipDropdown?: boolean;
|
||||||
|
showCheckbox?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function LinkCardCompact({
|
export default function LinkCardCompact({
|
||||||
link,
|
link,
|
||||||
flipDropdown,
|
flipDropdown,
|
||||||
|
showCheckbox,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const { collections } = useCollectionStore();
|
const { collections } = useCollectionStore();
|
||||||
const { links, setSelectedLinks, selectedLinks } = useLinkStore();
|
const { links, setSelectedLinks, selectedLinks } = useLinkStore();
|
||||||
|
@ -63,12 +65,14 @@ export default function LinkCardCompact({
|
||||||
className={`border-neutral-content relative items-center flex ${!showInfo && !isPWA() ? "hover:bg-base-300 p-3" : "py-3"
|
className={`border-neutral-content relative items-center flex ${!showInfo && !isPWA() ? "hover:bg-base-300 p-3" : "py-3"
|
||||||
} duration-200 rounded-lg`}
|
} duration-200 rounded-lg`}
|
||||||
>
|
>
|
||||||
|
{showCheckbox &&
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
className="checkbox checkbox-primary my-auto mr-2"
|
className="checkbox checkbox-primary my-auto mr-2"
|
||||||
checked={selectedLinks.includes(link.id)}
|
checked={selectedLinks.includes(link.id)}
|
||||||
onChange={() => handleCheckboxClick(link.id)}
|
onChange={() => handleCheckboxClick(link.id)}
|
||||||
/>
|
/>
|
||||||
|
}
|
||||||
<Link
|
<Link
|
||||||
href={generateLinkHref(link)}
|
href={generateLinkHref(link)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
|
@ -288,6 +288,7 @@ export default function Index() {
|
||||||
<ViewDropdown viewMode={viewMode} setViewMode={setViewMode} />
|
<ViewDropdown viewMode={viewMode} setViewMode={setViewMode} />
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<div className="flex gap-3 ml-3">
|
||||||
<input
|
<input
|
||||||
|
|
|
@ -168,7 +168,7 @@ export default function Dashboard() {
|
||||||
>
|
>
|
||||||
{links[0] ? (
|
{links[0] ? (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<LinkComponent links={links.slice(0, showLinks)} />
|
<LinkComponent links={links.slice(0, showLinks)} showCheckbox={false} />
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
|
@ -279,6 +279,7 @@ export default function Dashboard() {
|
||||||
{links.some((e) => e.pinnedBy && e.pinnedBy[0]) ? (
|
{links.some((e) => e.pinnedBy && e.pinnedBy[0]) ? (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<LinkComponent
|
<LinkComponent
|
||||||
|
showCheckbox={false}
|
||||||
links={links
|
links={links
|
||||||
.filter((e) => e.pinnedBy && e.pinnedBy[0])
|
.filter((e) => e.pinnedBy && e.pinnedBy[0])
|
||||||
.slice(0, showLinks)}
|
.slice(0, showLinks)}
|
||||||
|
|
Ŝarĝante…
Reference in New Issue