Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

minor change

daniel31x137222b1974565
diff --git a/apps/web/components/InstallApp.tsx b/apps/web/components/InstallApp.tsx
index a1fb23f4..647fb037 100644
--- a/apps/web/components/InstallApp.tsx
+++ b/apps/web/components/InstallApp.tsx
@@ -1,4 +1,4 @@
-import { isPWA } from "@/lib/client/utils";
+import { isPWA } from "@/lib/utils";
import React, { useState } from "react";
import { Trans } from "next-i18next";
diff --git a/apps/web/components/LinkViews/LinkComponents/LinkList.tsx b/apps/web/components/LinkViews/LinkComponents/LinkList.tsx
index f66d0238..774529f5 100644
--- a/apps/web/components/LinkViews/LinkComponents/LinkList.tsx
+++ b/apps/web/components/LinkViews/LinkComponents/LinkList.tsx
@@ -9,7 +9,7 @@ import LinkActions from "@/components/LinkViews/LinkComponents/LinkActions";
import LinkDate from "@/components/LinkViews/LinkComponents/LinkDate";
import LinkCollection from "@/components/LinkViews/LinkComponents/LinkCollection";
import LinkIcon from "@/components/LinkViews/LinkComponents/LinkIcon";
-import { isPWA } from "@/lib/client/utils";
+import { isPWA } from "@/lib/utils";
import usePermissions from "@/hooks/usePermissions";
import toast from "react-hot-toast";
import LinkTypeBadge from "./LinkTypeBadge";
diff --git a/apps/web/components/MobileNavigation.tsx b/apps/web/components/MobileNavigation.tsx
index fcaeb81e..96013401 100644
--- a/apps/web/components/MobileNavigation.tsx
+++ b/apps/web/components/MobileNavigation.tsx
@@ -1,4 +1,4 @@
-import { isIphone, isPWA } from "@/lib/client/utils";
+import { isIphone, isPWA } from "@/lib/utils";
import React from "react";
import { useState } from "react";
import NewLinkModal from "./ModalContent/NewLinkModal";
diff --git a/apps/web/components/MobileNavigationButton.tsx b/apps/web/components/MobileNavigationButton.tsx
index a0a13e1d..4369c585 100644
--- a/apps/web/components/MobileNavigationButton.tsx
+++ b/apps/web/components/MobileNavigationButton.tsx
@@ -1,4 +1,4 @@
-import { isPWA } from "@/lib/client/utils";
+import { isPWA } from "@/lib/utils";
import Link from "next/link";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
diff --git a/apps/web/lib/client/utils.ts b/apps/web/lib/client/utils.ts
deleted file mode 100644
index d105f9a6..00000000
--- a/apps/web/lib/client/utils.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-export function isPWA() {
- return (
- window.matchMedia("(display-mode: standalone)").matches ||
- (window.navigator as any).standalone ||
- document.referrer.includes("android-app://")
- );
-}
-
-export function isIphone() {
- return (
- /iPhone/.test(navigator.userAgent) &&
- !(window as unknown as { MSStream?: any }).MSStream
- );
-}
-
-import clsx, { ClassValue } from "clsx";
-import { twMerge } from "tailwind-merge";
-export const cn = (...classes: ClassValue[]) => twMerge(clsx(...classes));
diff --git a/apps/web/lib/utils.ts b/apps/web/lib/utils.ts
index bd0c391d..9318dac6 100644
--- a/apps/web/lib/utils.ts
+++ b/apps/web/lib/utils.ts
@@ -1,6 +1,21 @@
-import { clsx, type ClassValue } from "clsx"
-import { twMerge } from "tailwind-merge"
+import { clsx, type ClassValue } from "clsx";
+import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
- return twMerge(clsx(inputs))
+ return twMerge(clsx(inputs));
+}
+
+export function isPWA() {
+ return (
+ window.matchMedia("(display-mode: standalone)").matches ||
+ (window.navigator as any).standalone ||
+ document.referrer.includes("android-app://")
+ );
+}
+
+export function isIphone() {
+ return (
+ /iPhone/.test(navigator.userAgent) &&
+ !(window as unknown as { MSStream?: any }).MSStream
+ );
}
diff --git a/apps/web/pages/_app.tsx b/apps/web/pages/_app.tsx
index 6547e7b2..868f6449 100644
--- a/apps/web/pages/_app.tsx
+++ b/apps/web/pages/_app.tsx
@@ -8,7 +8,7 @@ import AuthRedirect from "@/layouts/AuthRedirect";
import toast from "react-hot-toast";
import { Toaster, ToastBar } from "react-hot-toast";
import { Session } from "next-auth";
-import { isPWA } from "@/lib/client/utils";
+import { isPWA } from "@/lib/utils";
// import useInitialData from "@/hooks/useInitialData";
import { appWithTranslation } from "next-i18next";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
diff --git a/apps/web/pages/settings/preference.tsx b/apps/web/pages/settings/preference.tsx
index 6658b625..0a86552b 100644
--- a/apps/web/pages/settings/preference.tsx
+++ b/apps/web/pages/settings/preference.tsx
@@ -10,10 +10,10 @@ import { AiTaggingMethod, LinksRouteTo } from "@linkwarden/prisma/client";
import { useUpdateUser, useUser } from "@linkwarden/router/user";
import { useConfig } from "@linkwarden/router/config";
import { useTags, useUpdateArchivalTags } from "@linkwarden/router/tags";
-import { cn } from "@/lib/client/utils";
import TagSelection from "@/components/InputSelect/TagSelection";
import { useArchivalTags } from "@/hooks/useArchivalTags";
import { isArchivalTag } from "@linkwarden/lib";
+import clsx from "clsx";
export default function Preference() {
const { t } = useTranslation();
@@ -473,7 +473,7 @@ export default function Preference() {
>
<button
onClick={() => toggleOption(tag, type)}
- className={cn(
+ className={clsx(
"py-1 px-2 btn btn-sm btn-square",
tag[type] ? "btn-primary" : "btn-ghost"
)}