⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.
TypeScript bookmarkbookmark-managercollaborationnextjsreact-nativeread-it-laterself-hostedtypescript
Replace useless ternarys with logical ANDs
Isaac Wisee79b98d3b000
diff --git a/components/CollectionCard.tsx b/components/CollectionCard.tsxindex da634cc5..cd7d80eb 100644--- a/components/CollectionCard.tsx+++ b/components/CollectionCard.tsx@@ -129,12 +129,12 @@ export default function CollectionCard({ collection, className }: Props) {className="flex items-center absolute bottom-3 left-3 z-10 btn px-2 btn-ghost rounded-full"onClick={() => setEditCollectionSharingModal(true)}>- {collectionOwner.id ? (+ {collectionOwner.id && (<ProfilePhotosrc={collectionOwner.image || undefined}name={collectionOwner.name}/>- ) : undefined}+ )}{collection.members.sort((a, b) => (a.userId as number) - (b.userId as number)).map((e, i) => {@@ -159,11 +159,9 @@ export default function CollectionCard({ collection, className }: Props) {<Linkhref={`/collections/${collection.id}`}style={{- backgroundImage: `linear-gradient(45deg, ${collection.color}30 10%, ${- settings.theme === "dark" ? "oklch(var(--b2))" : "oklch(var(--b2))"- } 50%, ${- settings.theme === "dark" ? "oklch(var(--b2))" : "oklch(var(--b2))"- } 100%)`,+ backgroundImage: `linear-gradient(45deg, ${collection.color}30 10%, ${settings.theme === "dark" ? "oklch(var(--b2))" : "oklch(var(--b2))"+ } 50%, ${settings.theme === "dark" ? "oklch(var(--b2))" : "oklch(var(--b2))"+ } 100%)`,}}className="card card-compact shadow-md hover:shadow-none duration-200 border border-neutral-content">@@ -178,12 +176,12 @@ export default function CollectionCard({ collection, className }: Props) {<div className="flex justify-end items-center"><div className="text-right"><div className="font-bold text-sm flex justify-end gap-1 items-center">- {collection.isPublic ? (+ {collection.isPublic && (<iclassName="bi-globe2 drop-shadow text-neutral"title="This collection is being shared publicly."></i>- ) : undefined}+ )}<iclassName="bi-link-45deg text-lg text-neutral"title="This collection is being shared publicly."@@ -203,24 +201,24 @@ export default function CollectionCard({ collection, className }: Props) {</div></div></Link>- {editCollectionModal ? (+ {editCollectionModal && (<EditCollectionModalonClose={() => setEditCollectionModal(false)}activeCollection={collection}/>- ) : undefined}- {editCollectionSharingModal ? (+ )}+ {editCollectionSharingModal && (<EditCollectionSharingModalonClose={() => setEditCollectionSharingModal(false)}activeCollection={collection}/>- ) : undefined}- {deleteCollectionModal ? (+ )}+ {deleteCollectionModal && (<DeleteCollectionModalonClose={() => setDeleteCollectionModal(false)}activeCollection={collection}/>- ) : undefined}+ )}</div>);}diff --git a/components/CollectionListing.tsx b/components/CollectionListing.tsxindex fbe2f7b5..b26e8cf4 100644--- a/components/CollectionListing.tsx+++ b/components/CollectionListing.tsx@@ -231,11 +231,10 @@ const renderItem = (return (<div ref={provided.innerRef} {...provided.draggableProps} className="mb-1"><div- className={`${- currentPath === `/collections/${collection.id}`+ className={`${currentPath === `/collections/${collection.id}`? "bg-primary/20 is-active": "hover:bg-neutral/20"- } duration-100 flex gap-1 items-center pr-2 pl-1 rounded-md`}+ } duration-100 flex gap-1 items-center pr-2 pl-1 rounded-md`}>{Icon(item as ExtendedTreeItem, onExpand, onCollapse)}@@ -253,12 +252,12 @@ const renderItem = (></i><p className="truncate w-full">{collection.name}</p>- {collection.isPublic ? (+ {collection.isPublic && (<iclassName="bi-globe2 text-sm text-black/50 dark:text-white/50 drop-shadow"title="This collection is being shared publicly."></i>- ) : undefined}+ )}<div className="drop-shadow text-neutral text-xs">{collection._count?.links}</div>diff --git a/components/LinkViews/LinkComponents/LinkActions.tsx b/components/LinkViews/LinkComponents/LinkActions.tsxindex c68dd060..41f40c52 100644--- a/components/LinkViews/LinkComponents/LinkActions.tsx+++ b/components/LinkViews/LinkComponents/LinkActions.tsx@@ -79,9 +79,8 @@ export default function LinkActions({return (<><div- className={`dropdown dropdown-left absolute ${- position || "top-3 right-3"- } ${alignToTop ? "" : "dropdown-end"} z-20`}+ className={`dropdown dropdown-left absolute ${position || "top-3 right-3"+ } ${alignToTop ? "" : "dropdown-end"} z-20`}><divtabIndex={0}@@ -92,9 +91,8 @@ export default function LinkActions({<i title="More" className="bi-three-dots text-xl" /></div><ul- className={`dropdown-content z-[20] menu shadow bg-base-200 border border-neutral-content rounded-box w-44 mr-1 ${- alignToTop ? "" : "translate-y-10"- }`}+ className={`dropdown-content z-[20] menu shadow bg-base-200 border border-neutral-content rounded-box w-44 mr-1 ${alignToTop ? "" : "translate-y-10"+ }`}><li><div@@ -110,7 +108,7 @@ export default function LinkActions({: t("pin_to_dashboard")}</div></li>- {linkInfo !== undefined && toggleShowInfo ? (+ {linkInfo !== undefined && toggleShowInfo && (<li><divrole="button"@@ -123,8 +121,8 @@ export default function LinkActions({{!linkInfo ? t("show_link_details") : t("hide_link_details")}</div></li>- ) : undefined}- {permissions === true || permissions?.canUpdate ? (+ )}+ {permissions === true || permissions?.canUpdate && (<li><divrole="button"@@ -137,7 +135,7 @@ export default function LinkActions({{t("edit_link")}</div></li>- ) : undefined}+ )}{link.type === "url" && (<li><div@@ -152,7 +150,7 @@ export default function LinkActions({</div></li>)}- {permissions === true || permissions?.canDelete ? (+ {permissions === true || permissions?.canDelete && (<li><divrole="button"@@ -165,28 +163,28 @@ export default function LinkActions({{t("delete")}</div></li>- ) : undefined}+ )}</ul></div>- {editLinkModal ? (+ {editLinkModal && (<EditLinkModalonClose={() => setEditLinkModal(false)}activeLink={link}/>- ) : undefined}- {deleteLinkModal ? (+ )}+ {deleteLinkModal && (<DeleteLinkModalonClose={() => setDeleteLinkModal(false)}activeLink={link}/>- ) : undefined}- {preservedFormatsModal ? (+ )}+ {preservedFormatsModal && (<PreservedFormatsModalonClose={() => setPreservedFormatsModal(false)}activeLink={link}/>- ) : undefined}+ )}{/* {expandedLink ? (<ExpandedLink onClose={() => setExpandedLink(false)} link={link} />) : undefined} */}diff --git a/components/LinkViews/LinkList.tsx b/components/LinkViews/LinkList.tsxindex 723c47e2..efb10c4e 100644--- a/components/LinkViews/LinkList.tsx+++ b/components/LinkViews/LinkList.tsx@@ -91,9 +91,8 @@ export default function LinkCardCompact({return (<><div- className={`${selectedStyle} border relative items-center flex ${- !showInfo && !isPWA() ? "hover:bg-base-300 p-3" : "py-3"- } duration-200 rounded-lg w-full`}+ className={`${selectedStyle} border relative items-center flex ${!showInfo && !isPWA() ? "hover:bg-base-300 p-3" : "py-3"+ } duration-200 rounded-lg w-full`}onClick={() =>selectable? handleCheckboxClick(link)@@ -139,9 +138,9 @@ export default function LinkCardCompact({<div className="mt-1 flex flex-col sm:flex-row sm:items-center gap-2 text-xs text-neutral"><div className="flex items-center gap-x-3 text-neutral flex-wrap">- {collection ? (+ {collection && (<LinkCollection link={link} collection={collection} />- ) : undefined}+ )}{link.name && <LinkTypeBadge link={link} />}<LinkDate link={link} /></div>@@ -153,8 +152,8 @@ export default function LinkCardCompact({collection={collection}position="top-3 right-3"flipDropdown={flipDropdown}- // toggleShowInfo={() => setShowInfo(!showInfo)}- // linkInfo={showInfo}+ // toggleShowInfo={() => setShowInfo(!showInfo)}+ // linkInfo={showInfo}/></div><divdiff --git a/components/MobileNavigation.tsx b/components/MobileNavigation.tsxindex fda7f980..34bb96aa 100644--- a/components/MobileNavigation.tsx+++ b/components/MobileNavigation.tsx@@ -9,7 +9,7 @@ import { useTranslation } from "next-i18next";type Props = {};-export default function MobileNavigation({}: Props) {+export default function MobileNavigation({ }: Props) {const { t } = useTranslation();const [newLinkModal, setNewLinkModal] = useState(false);const [newCollectionModal, setNewCollectionModal] = useState(false);@@ -21,9 +21,8 @@ export default function MobileNavigation({}: Props) {className={`fixed bottom-0 left-0 right-0 z-30 duration-200 sm:hidden`}><div- className={`w-full flex bg-base-100 ${- isIphone() && isPWA() ? "pb-5" : ""- } border-solid border-t-neutral-content border-t`}+ className={`w-full flex bg-base-100 ${isIphone() && isPWA() ? "pb-5" : ""+ } border-solid border-t-neutral-content border-t`}><MobileNavigationButton href={`/dashboard`} icon={"bi-house"} /><MobileNavigationButton@@ -84,15 +83,15 @@ export default function MobileNavigation({}: Props) {<MobileNavigationButton href={`/collections`} icon={"bi-folder"} /></div></div>- {newLinkModal ? (+ {newLinkModal && (<NewLinkModal onClose={() => setNewLinkModal(false)} />- ) : undefined}- {newCollectionModal ? (+ )}+ {newCollectionModal && (<NewCollectionModal onClose={() => setNewCollectionModal(false)} />- ) : undefined}- {uploadFileModal ? (+ )}+ {uploadFileModal && (<UploadFileModal onClose={() => setUploadFileModal(false)} />- ) : undefined}+ )}</>);}diff --git a/components/ModalContent/EditLinkModal.tsx b/components/ModalContent/EditLinkModal.tsxindex 1d873c7f..b509aa81 100644--- a/components/ModalContent/EditLinkModal.tsx+++ b/components/ModalContent/EditLinkModal.tsx@@ -72,7 +72,7 @@ export default function EditLinkModal({ onClose, activeLink }: Props) {<div className="divider mb-3 mt-1"></div>- {link.url ? (+ {link.url && (<Linkhref={link.url}className="truncate text-neutral flex gap-2 mb-5 w-fit max-w-full"@@ -82,7 +82,7 @@ export default function EditLinkModal({ onClose, activeLink }: Props) {<i className="bi-link-45deg text-xl" /><p>{shortenedURL}</p></Link>- ) : undefined}+ )}<div className="w-full"><p className="mb-2">{t("name")}</p>diff --git a/components/ModalContent/NewLinkModal.tsx b/components/ModalContent/NewLinkModal.tsxindex 02846873..680f9efe 100644--- a/components/ModalContent/NewLinkModal.tsx+++ b/components/ModalContent/NewLinkModal.tsx@@ -128,7 +128,7 @@ export default function NewLinkModal({ onClose }: Props) {</div></div><div className={"mt-2"}>- {optionsExpanded ? (+ {optionsExpanded && (<div className="mt-5"><div className="grid sm:grid-cols-2 gap-3"><div>@@ -163,7 +163,7 @@ export default function NewLinkModal({ onClose }: Props) {</div></div></div>- ) : undefined}+ )}</div><div className="flex justify-between items-center mt-5"><divdiff --git a/components/ModalContent/NewUserModal.tsx b/components/ModalContent/NewUserModal.tsxindex d83ef400..a00d14f3 100644--- a/components/ModalContent/NewUserModal.tsx+++ b/components/ModalContent/NewUserModal.tsx@@ -86,7 +86,7 @@ export default function NewUserModal({ onClose }: Props) {/></div>- {emailEnabled ? (+ {emailEnabled && (<div><p className="mb-2">{t("email")}</p><TextInput@@ -96,7 +96,7 @@ export default function NewUserModal({ onClose }: Props) {value={form.email}/></div>- ) : undefined}+ )}<div><p className="mb-2">diff --git a/components/ModalContent/PreservedFormatsModal.tsx b/components/ModalContent/PreservedFormatsModal.tsxindex 87e84a7d..4414b379 100644--- a/components/ModalContent/PreservedFormatsModal.tsx+++ b/components/ModalContent/PreservedFormatsModal.tsx@@ -150,16 +150,16 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {<p className="text-xl font-thin">{t("preserved_formats")}</p><div className="divider mb-2 mt-1"></div>{screenshotAvailable(link) ||- pdfAvailable(link) ||- readabilityAvailable(link) ||- monolithAvailable(link) ? (+ pdfAvailable(link) ||+ readabilityAvailable(link) ||+ monolithAvailable(link) ? (<p className="mb-3">{t("available_formats")}</p>) : ("")}<div className={`flex flex-col gap-3`}>- {monolithAvailable(link) ? (+ {monolithAvailable(link) && (<PreservedFormatRowname={t("webpage")}icon={"bi-filetype-html"}@@ -167,9 +167,9 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {activeLink={link}downloadable={true}/>- ) : undefined}+ )}- {screenshotAvailable(link) ? (+ {screenshotAvailable(link) && (<PreservedFormatRowname={t("screenshot")}icon={"bi-file-earmark-image"}@@ -181,9 +181,9 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {activeLink={link}downloadable={true}/>- ) : undefined}+ )}- {pdfAvailable(link) ? (+ {pdfAvailable(link) && (<PreservedFormatRowname={t("pdf")}icon={"bi-file-earmark-pdf"}@@ -191,16 +191,16 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {activeLink={link}downloadable={true}/>- ) : undefined}+ )}- {readabilityAvailable(link) ? (+ {readabilityAvailable(link) && (<PreservedFormatRowname={t("readable")}icon={"bi-file-earmark-text"}format={ArchivedFormat.readability}activeLink={link}/>- ) : undefined}+ )}{!isReady() && !atLeastOneFormatAvailable() ? (<div className={`w-full h-full flex flex-col justify-center p-10`}>@@ -213,7 +213,7 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {<p className="text-center text-2xl">{t("preservation_in_queue")}</p><p className="text-center text-lg">{t("check_back_later")}</p></div>- ) : !isReady() && atLeastOneFormatAvailable() ? (+ ) : !isReady() && atLeastOneFormatAvailable() && (<div className={`w-full h-full flex flex-col justify-center p-5`}><BeatLoadercolor="oklch(var(--p))"@@ -223,12 +223,11 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {<p className="text-center">{t("there_are_more_formats")}</p><p className="text-center text-sm">{t("check_back_later")}</p></div>- ) : undefined}+ )}<div- className={`flex flex-col sm:flex-row gap-3 items-center justify-center ${- isReady() ? "sm:mt " : ""- }`}+ className={`flex flex-col sm:flex-row gap-3 items-center justify-center ${isReady() ? "sm:mt " : ""+ }`}><Linkhref={`https://web.archive.org/web/${link?.url?.replace(diff --git a/components/ModalContent/UploadFileModal.tsx b/components/ModalContent/UploadFileModal.tsxindex 24804310..1400db1f 100644--- a/components/ModalContent/UploadFileModal.tsx+++ b/components/ModalContent/UploadFileModal.tsx@@ -157,7 +157,7 @@ export default function UploadFileModal({ onClose }: Props) {</div><div className="sm:col-span-2 col-span-5"><p className="mb-2">{t("collection")}</p>- {link.collection.name ? (+ {link.collection.name && (<CollectionSelectiononChange={setCollection}defaultValue={{@@ -165,10 +165,10 @@ export default function UploadFileModal({ onClose }: Props) {value: link.collection.id,}}/>- ) : null}+ )}</div></div>- {optionsExpanded ? (+ {optionsExpanded && (<div className="mt-5"><div className="grid sm:grid-cols-2 gap-3"><div>@@ -203,7 +203,7 @@ export default function UploadFileModal({ onClose }: Props) {</div></div></div>- ) : undefined}+ )}<div className="flex justify-between items-center mt-5"><divonClick={() => setOptionsExpanded(!optionsExpanded)}diff --git a/components/Navbar.tsx b/components/Navbar.tsxindex dcc78c58..888c56b6 100644--- a/components/Navbar.tsx+++ b/components/Navbar.tsx@@ -120,15 +120,15 @@ export default function Navbar() {</ClickAwayHandler></div>) : null}- {newLinkModal ? (+ {newLinkModal && (<NewLinkModal onClose={() => setNewLinkModal(false)} />- ) : undefined}- {newCollectionModal ? (+ )}+ {newCollectionModal && (<NewCollectionModal onClose={() => setNewCollectionModal(false)} />- ) : undefined}- {uploadFileModal ? (+ )}+ {uploadFileModal && (<UploadFileModal onClose={() => setUploadFileModal(false)} />- ) : undefined}+ )}</div>);}diff --git a/components/NoLinksFound.tsx b/components/NoLinksFound.tsxindex 516dfb68..b42516a7 100644--- a/components/NoLinksFound.tsx+++ b/components/NoLinksFound.tsx@@ -39,9 +39,9 @@ export default function NoLinksFound({ text }: Props) {</span></div></div>- {newLinkModal ? (+ {newLinkModal && (<NewLinkModal onClose={() => setNewLinkModal(false)} />- ) : undefined}+ )}</div>);}diff --git a/components/PreserverdFormatRow.tsx b/components/PreserverdFormatRow.tsxindex ce0f21d9..e28d43dd 100644--- a/components/PreserverdFormatRow.tsx+++ b/components/PreserverdFormatRow.tsx@@ -97,19 +97,18 @@ export default function PreservedFormatRow({</div><div className="flex gap-1">- {downloadable || false ? (+ {downloadable || false && (<divonClick={() => handleDownload()}className="btn btn-sm btn-square"><i className="bi-cloud-arrow-down text-xl text-neutral" /></div>- ) : undefined}+ )}<Link- href={`${- isPublic ? "/public" : ""- }/preserved/${link?.id}?format=${format}`}+ href={`${isPublic ? "/public" : ""+ }/preserved/${link?.id}?format=${format}`}target="_blank"className="btn btn-sm btn-square">diff --git a/components/ReadableView.tsx b/components/ReadableView.tsxindex b600236a..b862b383 100644--- a/components/ReadableView.tsx+++ b/components/ReadableView.tsx@@ -183,7 +183,7 @@ export default function ReadableView({ link }: Props) {link?.name || link?.description || link?.url || "")}</p>- {link?.url ? (+ {link?.url && (<Linkhref={link?.url || ""}title={link?.url}@@ -192,11 +192,9 @@ export default function ReadableView({ link }: Props) {><i className="bi-link-45deg"></i>- {isValidUrl(link?.url || "")- ? new URL(link?.url as string).host- : undefined}+ {isValidUrl(link?.url || "") && new URL(link?.url as string).host}</Link>- ) : undefined}+ )}</div></div>@@ -231,10 +229,10 @@ export default function ReadableView({ link }: Props) {<p className="min-w-fit text-sm text-neutral">{date? new Date(date).toLocaleString("en-US", {- year: "numeric",- month: "long",- day: "numeric",- })+ year: "numeric",+ month: "long",+ day: "numeric",+ }): undefined}</p>@@ -259,9 +257,8 @@ export default function ReadableView({ link }: Props) {></div>) : (<div- className={`w-full h-full flex flex-col justify-center p-10 ${- link?.readable === "pending" || !link?.readable ? "skeleton" : ""- }`}+ className={`w-full h-full flex flex-col justify-center p-10 ${link?.readable === "pending" || !link?.readable ? "skeleton" : ""+ }`}><svgxmlns="http://www.w3.org/2000/svg"diff --git a/layouts/CenteredForm.tsx b/layouts/CenteredForm.tsxindex 841036bc..b40c545b 100644--- a/layouts/CenteredForm.tsx+++ b/layouts/CenteredForm.tsx@@ -23,22 +23,21 @@ export default function CenteredForm({data-testid={dataTestId}><div className="m-auto flex flex-col gap-2 w-full">- {settings.theme ? (+ {settings.theme && (<Image- src={`/linkwarden_${- settings.theme === "dark" ? "dark" : "light"- }.png`}+ src={`/linkwarden_${settings.theme === "dark" ? "dark" : "light"+ }.png`}width={640}height={136}alt="Linkwarden"className="h-12 w-fit mx-auto"/>- ) : undefined}- {text ? (+ )}+ {text && (<p className="text-lg max-w-[30rem] min-w-80 w-full mx-auto font-semibold px-2 text-center">{text}</p>- ) : undefined}+ )}{children}<p className="text-center text-xs text-neutral mb-5"><Transdiff --git a/layouts/MainLayout.tsx b/layouts/MainLayout.tsxindex 2c606e54..442051e0 100644--- a/layouts/MainLayout.tsx+++ b/layouts/MainLayout.tsx@@ -34,9 +34,9 @@ export default function MainLayout({ children }: Props) {return (<div className="flex" data-testid="dashboard-wrapper">- {showAnnouncement ? (+ {showAnnouncement && (<Announcement toggleAnnouncementBar={toggleAnnouncementBar} />- ) : undefined}+ )}<div className="hidden lg:block"><Sidebar className={`fixed top-0`} /></div>diff --git a/pages/collections/[id].tsx b/pages/collections/[id].tsxindex bd24a95c..b50d6df1 100644--- a/pages/collections/[id].tsx+++ b/pages/collections/[id].tsx@@ -115,9 +115,8 @@ export default function Index() {<divclassName="h-[60rem] p-5 flex gap-3 flex-col"style={{- backgroundImage: `linear-gradient(${activeCollection?.color}20 10%, ${- settings.theme === "dark" ? "#262626" : "#f3f4f6"- } 13rem, ${settings.theme === "dark" ? "#171717" : "#ffffff"} 100%)`,+ backgroundImage: `linear-gradient(${activeCollection?.color}20 10%, ${settings.theme === "dark" ? "#262626" : "#f3f4f6"+ } 13rem, ${settings.theme === "dark" ? "#171717" : "#ffffff"} 100%)`,}}>{activeCollection && (@@ -211,12 +210,12 @@ export default function Index() {className="flex items-center btn px-2 btn-ghost rounded-full w-fit"onClick={() => setEditCollectionSharingModal(true)}>- {collectionOwner.id ? (+ {collectionOwner.id && (<ProfilePhotosrc={collectionOwner.image || undefined}name={collectionOwner.name}/>- ) : undefined}+ )}{activeCollection.members.sort((a, b) => (a.userId as number) - (b.userId as number)).map((e, i) => {@@ -241,20 +240,20 @@ export default function Index() {<p className="text-neutral text-sm">{activeCollection.members.length > 0 &&- activeCollection.members.length === 1+ activeCollection.members.length === 1? t("by_author_and_other", {+ author: collectionOwner.name,+ count: activeCollection.members.length,+ })+ : activeCollection.members.length > 0 &&+ activeCollection.members.length !== 1+ ? t("by_author_and_others", {author: collectionOwner.name,count: activeCollection.members.length,})- : activeCollection.members.length > 0 &&- activeCollection.members.length !== 1- ? t("by_author_and_others", {- author: collectionOwner.name,- count: activeCollection.members.length,- }): t("by_author", {- author: collectionOwner.name,- })}+ author: collectionOwner.name,+ })}</p></div></div>@@ -299,15 +298,15 @@ export default function Index() {setSortBy={setSortBy}editMode={permissions === true ||- permissions?.canUpdate ||- permissions?.canDelete+ permissions?.canUpdate ||+ permissions?.canDelete? editMode: undefined}setEditMode={permissions === true ||- permissions?.canUpdate ||- permissions?.canDelete+ permissions?.canUpdate ||+ permissions?.canDelete? setEditMode: undefined}@@ -315,11 +314,11 @@ export default function Index() {<p>{activeCollection?._count?.links === 1? t("showing_count_result", {- count: activeCollection?._count?.links,- })+ count: activeCollection?._count?.links,+ }): t("showing_count_results", {- count: activeCollection?._count?.links,- })}+ count: activeCollection?._count?.links,+ })}</p></LinkListOptions>diff --git a/pages/collections/index.tsx b/pages/collections/index.tsxindex 642e3dd4..717732fb 100644--- a/pages/collections/index.tsx+++ b/pages/collections/index.tsx@@ -58,7 +58,7 @@ export default function Collections() {</div></div>- {sortedCollections.filter((e) => e.ownerId !== data?.user.id)[0] ? (+ {sortedCollections.filter((e) => e.ownerId !== data?.user.id)[0] && (<><PageHeadericon={"bi-folder"}@@ -74,11 +74,11 @@ export default function Collections() {})}</div></>- ) : undefined}+ )}</div>- {newCollectionModal ? (+ {newCollectionModal && (<NewCollectionModal onClose={() => setNewCollectionModal(false)} />- ) : undefined}+ )}</MainLayout>);}diff --git a/pages/dashboard.tsx b/pages/dashboard.tsxindex 3d1fdb6f..78239dea 100644--- a/pages/dashboard.tsx+++ b/pages/dashboard.tsx@@ -324,9 +324,9 @@ export default function Dashboard() {)}</div></div>- {newLinkModal ? (+ {newLinkModal && (<NewLinkModal onClose={() => setNewLinkModal(false)} />- ) : undefined}+ )}</MainLayout>);}diff --git a/pages/login.tsx b/pages/login.tsxindex c1bc8d83..4eb59c8c 100644--- a/pages/login.tsx+++ b/pages/login.tsx@@ -203,9 +203,9 @@ export default function Login({{t("login")}</Button>- {availableLogins.buttonAuths.length > 0 ? (+ {availableLogins.buttonAuths.length > 0 && (<div className="divider my-1">{t("or_continue_with")}</div>- ) : undefined}+ )}</>);}@@ -224,9 +224,9 @@ export default function Login({loading={submitLoader}>{value.name.toLowerCase() === "google" ||- value.name.toLowerCase() === "apple" ? (- <i className={"bi-" + value.name.toLowerCase()}></i>- ) : undefined}+ value.name.toLowerCase() === "apple" && (+ <i className={"bi-" + value.name.toLowerCase()}></i>+ )}{value.name}</Button></React.Fragment>diff --git a/pages/public/collections/[id].tsx b/pages/public/collections/[id].tsxindex 47e074ff..454a9570 100644--- a/pages/public/collections/[id].tsx+++ b/pages/public/collections/[id].tsx@@ -104,16 +104,17 @@ export default function PublicCollections() {// @ts-ignoreconst LinkComponent = linkView[viewMode];- return collection ? (+ if (!collection) return null;++ return (<divclassName="h-96"style={{- backgroundImage: `linear-gradient(${collection?.color}30 10%, ${- settings.theme === "dark" ? "#262626" : "#f3f4f6"- } 13rem, ${settings.theme === "dark" ? "#171717" : "#ffffff"} 100%)`,+ backgroundImage: `linear-gradient(${collection?.color}30 10%, ${settings.theme === "dark" ? "#262626" : "#f3f4f6"+ } 13rem, ${settings.theme === "dark" ? "#171717" : "#ffffff"} 100%)`,}}>- {collection ? (+ {collection && (<Head><title>{collection.name} | Linkwarden</title><meta@@ -122,7 +123,7 @@ export default function PublicCollections() {key="title"/></Head>- ) : undefined}+ )}<div className="lg:w-3/4 w-full mx-auto p-5 bg"><div className="flex items-center justify-between"><p className="text-4xl font-thin mb-2 capitalize mt-10">@@ -151,12 +152,12 @@ export default function PublicCollections() {className="flex items-center btn px-2 btn-ghost rounded-full"onClick={() => setEditCollectionSharingModal(true)}>- {collectionOwner.id ? (+ {collectionOwner.id && (<ProfilePhotosrc={collectionOwner.image || undefined}name={collectionOwner.name}/>- ) : undefined}+ )}{collection.members.sort((a, b) => (a.userId as number) - (b.userId as number)).map((e, i) => {@@ -181,20 +182,20 @@ export default function PublicCollections() {<p className="text-neutral text-sm">{collection.members.length > 0 &&- collection.members.length === 1+ collection.members.length === 1? t("by_author_and_other", {+ author: collectionOwner.name,+ count: collection.members.length,+ })+ : collection.members.length > 0 &&+ collection.members.length !== 1+ ? t("by_author_and_others", {author: collectionOwner.name,count: collection.members.length,})- : collection.members.length > 0 &&- collection.members.length !== 1- ? t("by_author_and_others", {- author: collectionOwner.name,- count: collection.members.length,- }): t("by_author", {- author: collectionOwner.name,- })}+ author: collectionOwner.name,+ })}</p></div></div>@@ -218,11 +219,11 @@ export default function PublicCollections() {placeholder={collection._count?.links === 1? t("search_count_link", {- count: collection._count?.links,- })+ count: collection._count?.links,+ }): t("search_count_links", {- count: collection._count?.links,- })+ count: collection._count?.links,+ })}/></LinkListOptions>@@ -248,15 +249,13 @@ export default function PublicCollections() {</p> */}</div></div>- {editCollectionSharingModal ? (+ {editCollectionSharingModal && (<EditCollectionSharingModalonClose={() => setEditCollectionSharingModal(false)}activeCollection={collection}/>- ) : undefined}+ )}</div>- ) : (- <></>);}diff --git a/pages/register.tsx b/pages/register.tsxindex 4eba2bc3..6e7fc1e9 100644--- a/pages/register.tsx+++ b/pages/register.tsx@@ -133,9 +133,9 @@ export default function Register({loading={submitLoader}>{value.name.toLowerCase() === "google" ||- value.name.toLowerCase() === "apple" ? (- <i className={"bi-" + value.name.toLowerCase()}></i>- ) : undefined}+ value.name.toLowerCase() === "apple" && (+ <i className={"bi-" + value.name.toLowerCase()}></i>+ )}{value.name}</Button></React.Fragment>@@ -149,8 +149,8 @@ export default function Register({text={process.env.NEXT_PUBLIC_STRIPE? t("trial_offer_desc", {- count: Number(process.env.NEXT_PUBLIC_TRIAL_PERIOD_DAYS || 14),- })+ count: Number(process.env.NEXT_PUBLIC_TRIAL_PERIOD_DAYS || 14),+ }): t("register_desc")}data-testid="registration-form"@@ -201,7 +201,7 @@ export default function Register({</div>)}- {emailEnabled ? (+ {emailEnabled && (<div><p className="text-sm w-fit font-semibold mb-1">{t("email")}</p>@@ -214,7 +214,7 @@ export default function Register({onChange={(e) => setForm({ ...form, email: e.target.value })}/></div>- ) : undefined}+ )}<div className="w-full"><p className="text-sm w-fit font-semibold mb-1">@@ -248,7 +248,7 @@ export default function Register({/></div>- {process.env.NEXT_PUBLIC_STRIPE ? (+ {process.env.NEXT_PUBLIC_STRIPE && (<div className="text-xs text-neutral mb-3"><p><Trans@@ -270,7 +270,7 @@ export default function Register({/></p></div>- ) : undefined}+ )}<Buttontype="submit"@@ -282,9 +282,9 @@ export default function Register({{t("sign_up")}</Button>- {availableLogins.buttonAuths.length > 0 ? (+ {availableLogins.buttonAuths.length > 0 && (<div className="divider my-1">{t("or_continue_with")}</div>- ) : undefined}+ )}{displayLoginExternalButton()}<div>@@ -298,7 +298,7 @@ export default function Register({{t("login")}</Link></div>- {process.env.NEXT_PUBLIC_STRIPE ? (+ {process.env.NEXT_PUBLIC_STRIPE && (<div className="text-neutral text-center flex items-baseline gap-1 justify-center"><p>{t("need_help")}</p><Link@@ -309,7 +309,7 @@ export default function Register({{t("get_in_touch")}</Link></div>- ) : undefined}+ )}</div></div></form>diff --git a/pages/settings/access-tokens.tsx b/pages/settings/access-tokens.tsxindex e526e2fa..9e9c23ad 100644--- a/pages/settings/access-tokens.tsx+++ b/pages/settings/access-tokens.tsx@@ -48,7 +48,7 @@ export default function AccessTokens() {{t("new_token")}</button>- {tokens.length > 0 ? (+ {tokens.length > 0 && (<table className="table mt-2 overflow-x-auto"><thead><tr>@@ -93,12 +93,12 @@ export default function AccessTokens() {))}</tbody></table>- ) : undefined}+ )}</div>- {newTokenModal ? (+ {newTokenModal && (<NewTokenModal onClose={() => setNewTokenModal(false)} />- ) : undefined}+ )}{revokeTokenModal && selectedToken && (<RevokeTokenModalonClose={() => {diff --git a/pages/settings/account.tsx b/pages/settings/account.tsxindex cb464427..2ba80faf 100644--- a/pages/settings/account.tsx+++ b/pages/settings/account.tsx@@ -29,19 +29,19 @@ export default function Account() {!objectIsEmpty(account)? account: ({- // @ts-ignore- id: null,- name: "",- username: "",- email: "",- emailVerified: null,- password: undefined,- image: "",- isPrivate: true,- // @ts-ignore- createdAt: null,- whitelistedUsers: [],- } as unknown as AccountSettings)+ // @ts-ignore+ id: null,+ name: "",+ username: "",+ email: "",+ emailVerified: null,+ password: undefined,+ image: "",+ isPrivate: true,+ // @ts-ignore+ createdAt: null,+ whitelistedUsers: [],+ } as unknown as AccountSettings));const { t } = useTranslation();@@ -176,7 +176,7 @@ export default function Account() {onChange={(e) => setUser({ ...user, username: e.target.value })}/></div>- {emailEnabled ? (+ {emailEnabled && (<div><p className="mb-2">{t("email")}</p><TextInput@@ -185,7 +185,7 @@ export default function Account() {onChange={(e) => setUser({ ...user, email: e.target.value })}/></div>- ) : undefined}+ )}<div><p className="mb-2">{t("language")}</p><select@@ -418,9 +418,7 @@ export default function Account() {<p>{t("delete_account_warning")}- {process.env.NEXT_PUBLIC_STRIPE- ? " " + t("cancel_subscription_notice")- : undefined}+ {process.env.NEXT_PUBLIC_STRIPE && " " + t("cancel_subscription_notice")}</p></div>@@ -429,14 +427,14 @@ export default function Account() {</Link></div>- {emailChangeVerificationModal ? (+ {emailChangeVerificationModal && (<EmailChangeVerificationModalonClose={() => setEmailChangeVerificationModal(false)}onSubmit={submit}oldEmail={account.email || ""}newEmail={user.email || ""}/>- ) : undefined}+ )}</SettingsLayout>);}diff --git a/pages/settings/delete.tsx b/pages/settings/delete.tsxindex 2222ca80..0d11b877 100644--- a/pages/settings/delete.tsx+++ b/pages/settings/delete.tsx@@ -83,7 +83,7 @@ export default function Delete() {/></div>- {process.env.NEXT_PUBLIC_STRIPE ? (+ {process.env.NEXT_PUBLIC_STRIPE && (<fieldset className="border rounded-md p-2 border-primary"><legend className="px-3 py-1 text-sm sm:text-base border rounded-md border-primary"><b>{t("optional")}</b> <i>{t("feedback_help")}</i>@@ -123,7 +123,7 @@ export default function Delete() {/></div></fieldset>- ) : undefined}+ )}<ButtonclassName="mx-auto"