mirror of
https://github.com/linkwarden/linkwarden.git
synced 2026-06-30 15:56:58 +00:00
22 lines
516 B
TypeScript
22 lines
516 B
TypeScript
import { clsx, type ClassValue } from "clsx";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
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
|
|
);
|
|
}
|