From 30cc9e8016ca082f93bf8a700eb04a98e295687d Mon Sep 17 00:00:00 2001 From: scanash00 Date: Thu, 22 Jan 2026 17:51:05 -0900 Subject: [PATCH] add aturi.to to share dropdown (universal url) --- web/src/components/Icons.jsx | 18 ++++++++++++++++++ web/src/components/ShareMenu.jsx | 27 ++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/web/src/components/Icons.jsx b/web/src/components/Icons.jsx index 79bf5b9..f38c0a9 100644 --- a/web/src/components/Icons.jsx +++ b/web/src/components/Icons.jsx @@ -333,3 +333,21 @@ export function ReplyIcon({ size = 18 }) { ); } + +export function AturiIcon({ size = 18 }) { + return ( + + + + + ); +} diff --git a/web/src/components/ShareMenu.jsx b/web/src/components/ShareMenu.jsx index 5d05efe..9921204 100644 --- a/web/src/components/ShareMenu.jsx +++ b/web/src/components/ShareMenu.jsx @@ -1,6 +1,6 @@ import { useState, useRef, useEffect } from "react"; import { Copy, ExternalLink, Check } from "lucide-react"; -import { BlueskyIcon } from "./Icons"; +import { BlueskyIcon, AturiIcon } from "./Icons"; const BLUESKY_COLOR = "#1185fe"; @@ -100,6 +100,7 @@ const BLUESKY_FORKS = [ export default function ShareMenu({ uri, text, customUrl, handle, type }) { const [isOpen, setIsOpen] = useState(false); const [copied, setCopied] = useState(false); + const [copiedAturi, setCopiedAturi] = useState(false); const menuRef = useRef(null); const getShareUrl = () => { @@ -163,6 +164,22 @@ export default function ShareMenu({ uri, text, customUrl, handle, type }) { } }; + const handleCopyAturi = async () => { + const aturiUrl = uri ? uri.replace("at://", "https://aturi.to/") : ""; + if (!aturiUrl) return; + + try { + await navigator.clipboard.writeText(aturiUrl); + setCopiedAturi(true); + setTimeout(() => { + setCopiedAturi(false); + setIsOpen(false); + }, 1500); + } catch { + prompt("Copy this link:", aturiUrl); + } + }; + const handleSystemShare = async () => { if (navigator.share) { try { @@ -225,6 +242,14 @@ export default function ShareMenu({ uri, text, customUrl, handle, type }) { {copied ? : } {copied ? "Copied!" : "Copy Link"} + {navigator.share && (