link secção nova look
This commit is contained in:
28
src/App.jsx
28
src/App.jsx
@@ -7,7 +7,7 @@ import {
|
||||
PanelLeftClose, PanelLeftOpen, Sparkles, CloudSun,
|
||||
ArrowRight, Droplets, CheckCircle2, PieChart, History,
|
||||
X, Download, Bell, Globe, Filter, ShoppingBag, Share2,
|
||||
FolderOpen, Tag
|
||||
FolderOpen, Tag, Link
|
||||
} from 'lucide-react';
|
||||
|
||||
import {
|
||||
@@ -162,6 +162,23 @@ export default function App() {
|
||||
}
|
||||
};
|
||||
|
||||
const handlePasteSharedLink = () => {
|
||||
const link = window.prompt(t('pasteSharedLookLink') || 'Cole o link do look partilhado:');
|
||||
if (link) {
|
||||
try {
|
||||
const url = new URL(link);
|
||||
const sharedId = url.searchParams.get('shared');
|
||||
if (sharedId) {
|
||||
fetchSharedLook(sharedId);
|
||||
} else {
|
||||
alert(t('invalidSharedLink') || 'Link inválido. Certifique-se de copiar o link completo.');
|
||||
}
|
||||
} catch (e) {
|
||||
alert(t('invalidSharedLink') || 'Link inválido. Certifique-se de copiar o link completo.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (editingItem && editingItem.color) {
|
||||
setItemColors(editingItem.color.split(',').map(c => c.trim()).filter(Boolean));
|
||||
@@ -1360,7 +1377,14 @@ export default function App() {
|
||||
<h3 className="text-2xl font-black tracking-tighter text-inherit">{t('lookHistory')} <span className="text-sm font-bold opacity-40">— {t('availableLooks')} ({availableLooks.length})</span></h3>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Filter size={16} className="text-gray-400" />
|
||||
<button
|
||||
onClick={handlePasteSharedLink}
|
||||
className={`flex items-center gap-2 px-4 py-2 rounded-xl font-black text-[10px] uppercase tracking-widest transition-colors ${darkMode ? 'bg-primary-900/30 text-primary-400 hover:bg-primary-900/50' : 'bg-primary-50 text-primary-600 hover:bg-primary-100'}`}
|
||||
title={t('pasteSharedLookLink') || 'Colar link de look'}
|
||||
>
|
||||
<Link size={14} /> <span className="hidden sm:inline">{t('pasteLink') || 'Colar Link'}</span>
|
||||
</button>
|
||||
<Filter size={16} className="text-gray-400 ml-2" />
|
||||
<select
|
||||
value={colorFilter}
|
||||
onChange={(e) => setColorFilter(e.target.value)}
|
||||
|
||||
Reference in New Issue
Block a user