From 007aa355210db957b1240f43769f8a3c43140ae8 Mon Sep 17 00:00:00 2001 From: belisards Date: Sun, 3 May 2026 17:25:10 -0300 Subject: [PATCH] feat(admin): drop ShareButton and View Public Site from header --- app/admin/page.tsx | 12 ------ components/share-button.tsx | 79 ------------------------------------- 2 files changed, 91 deletions(-) delete mode 100644 components/share-button.tsx diff --git a/app/admin/page.tsx b/app/admin/page.tsx index 747bc53..ef21595 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -10,7 +10,6 @@ import StatsGrid from '@/components/admin/StatsGrid'; import SettingsSection from '@/components/admin/SettingsSection'; import WishlistCard from '@/components/admin/WishlistCard'; import CreateWishlistModal from '@/components/admin/CreateWishlistModal'; -import ShareButton from '@/components/share-button'; export default function AdminPage() { return ( @@ -143,17 +142,6 @@ function AdminPageContent() { subtitle="Manage your wishlists and items" actions={ <> - - - View Public Site - { - // Use current URL if not provided - const shareUrl = url || window.location.href; - - // Check if Web Share API is supported - if (!navigator.share) { - setIsSupported(false); - // Fallback: copy to clipboard - try { - await navigator.clipboard.writeText(shareUrl); - alert('Link copiado!'); - } catch (err) { - console.error('Failed to copy:', err); - alert('Não foi possível compartilhar'); - } - return; - } - - try { - await navigator.share({ - title, - text, - url: shareUrl, - }); - } catch (err: any) { - // User cancelled or share failed - if (err.name !== 'AbortError') { - console.error('Error sharing:', err); - } - } - }; - - if (!isSupported && typeof window !== 'undefined' && !navigator.clipboard) { - // Don't show button if neither share nor clipboard is supported - return null; - } - - return ( - - ); -}