diff --git a/web/public/locales/cs/translation.json b/web/public/locales/cs/translation.json index 26f7527..bf4b356 100644 --- a/web/public/locales/cs/translation.json +++ b/web/public/locales/cs/translation.json @@ -209,6 +209,7 @@ "sidebar": { "downloadForFirefox": "Stáhnout pro Firefox", "downloadForEdge": "Stáhnout pro Edge", + "downloadForSafari": "Stáhnout pro Safari", "downloadForChrome": "Stáhnout pro Chrome", "trending": "Populární", "searchPlaceholder": "Vyhledávejte napříč uživateli, tagy, URL…", diff --git a/web/public/locales/de/translation.json b/web/public/locales/de/translation.json index 9f9829f..896e669 100644 --- a/web/public/locales/de/translation.json +++ b/web/public/locales/de/translation.json @@ -32,6 +32,7 @@ "sidebar": { "downloadForFirefox": "Für Firefox herunterladen", "downloadForEdge": "Für Edge herunterladen", + "downloadForSafari": "Für Safari herunterladen", "downloadForChrome": "Für Chrome herunterladen", "getExtension": "Hol dir die Erweiterung", "trending": "Im Trend", diff --git a/web/public/locales/en/translation.json b/web/public/locales/en/translation.json index 533fd85..8eb4b2c 100644 --- a/web/public/locales/en/translation.json +++ b/web/public/locales/en/translation.json @@ -34,6 +34,7 @@ "extensionTagline": "Highlight, annotate, and bookmark from any page.", "downloadForFirefox": "Download for Firefox", "downloadForEdge": "Download for Edge", + "downloadForSafari": "Download for Safari", "downloadForChrome": "Download for Chrome", "trending": "Trending", "nothingTrending": "Nothing trending right now.", diff --git a/web/public/locales/es/translation.json b/web/public/locales/es/translation.json index ff0305b..3f2cf6f 100644 --- a/web/public/locales/es/translation.json +++ b/web/public/locales/es/translation.json @@ -34,6 +34,7 @@ "extensionTagline": "Resalta, anota y guarda marcadores desde cualquier página.", "downloadForFirefox": "Descargar para Firefox", "downloadForEdge": "Descargar para Edge", + "downloadForSafari": "Descargar para Safari", "downloadForChrome": "Descargar para Chrome", "trending": "Tendencias", "nothingTrending": "No hay nada en tendencia ahora mismo.", diff --git a/web/src/components/navigation/RightSidebar.tsx b/web/src/components/navigation/RightSidebar.tsx index 81fdfe8..7412f81 100644 --- a/web/src/components/navigation/RightSidebar.tsx +++ b/web/src/components/navigation/RightSidebar.tsx @@ -29,11 +29,14 @@ export default function RightSidebar({ onNavigate }: RightSidebarProps) { else window.location.href = path; }; const [tags, setTags] = useState([]); - const [browser] = useState<"chrome" | "firefox" | "edge" | "other">(() => { + const [browser] = useState< + "chrome" | "firefox" | "edge" | "safari" | "other" + >(() => { if (typeof navigator === "undefined") return "other"; const ua = navigator.userAgent; if (/Edg\//i.test(ua)) return "edge"; if (/Firefox/i.test(ua)) return "firefox"; + if (/^((?!chrome|android).)*safari/i.test(ua)) return "safari"; if (/Chrome/i.test(ua)) return "chrome"; return "other"; }); @@ -142,7 +145,9 @@ export default function RightSidebar({ onNavigate }: RightSidebarProps) { ? "https://addons.mozilla.org/en-US/firefox/addon/margin/" : browser === "edge" ? "https://microsoftedge.microsoft.com/addons/detail/margin/nfjnmllpdgcdnhmmggjihjbidmeadddn" - : "https://chromewebstore.google.com/detail/margin/cgpmbiiagnehkikhcbnhiagfomajncpa"; + : browser === "safari" + ? "https://apps.apple.com/us/app/margin-for-safari/id6773549512" + : "https://chromewebstore.google.com/detail/margin/cgpmbiiagnehkikhcbnhiagfomajncpa"; return (