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)}
|
||||
|
||||
@@ -167,6 +167,9 @@ export const translations = {
|
||||
themeColorTitle: "Cor do Tema",
|
||||
personalizeColorDesc: "Personalize a cor",
|
||||
saveChanges: "Guardar Alterações",
|
||||
pasteLink: "Colar Link",
|
||||
pasteSharedLookLink: "Cole o link do look partilhado:",
|
||||
invalidSharedLink: "Link inválido. Certifique-se de copiar o link completo.",
|
||||
},
|
||||
EN: {
|
||||
loginModeIntro: "The Future of Your Style",
|
||||
@@ -336,6 +339,9 @@ export const translations = {
|
||||
themeColorTitle: "Theme Color",
|
||||
personalizeColorDesc: "Personalize the color",
|
||||
saveChanges: "Save Changes",
|
||||
pasteLink: "Paste Link",
|
||||
pasteSharedLookLink: "Paste the shared look link:",
|
||||
invalidSharedLink: "Invalid link. Make sure you copied the full link.",
|
||||
},
|
||||
ES: {
|
||||
loginModeIntro: "El Futuro de Tu Estilo",
|
||||
@@ -505,6 +511,9 @@ export const translations = {
|
||||
themeColorTitle: "Color del Tema",
|
||||
personalizeColorDesc: "Personaliza el color",
|
||||
saveChanges: "Guardar Cambios",
|
||||
pasteLink: "Pegar Enlace",
|
||||
pasteSharedLookLink: "Pega el enlace del look compartido:",
|
||||
invalidSharedLink: "Enlace no válido. Asegúrate de copiar el enlace completo.",
|
||||
},
|
||||
FR: {
|
||||
loginModeIntro: "Le Futur de Ton Style",
|
||||
@@ -674,6 +683,9 @@ export const translations = {
|
||||
themeColorTitle: "Couleur du Thème",
|
||||
personalizeColorDesc: "Personnaliser la couleur",
|
||||
saveChanges: "Enregistrer les Modifications",
|
||||
pasteLink: "Coller le Lien",
|
||||
pasteSharedLookLink: "Collez le lien du look partagé :",
|
||||
invalidSharedLink: "Lien invalide. Assurez-vous d'avoir copié le lien complet.",
|
||||
},
|
||||
DE: {
|
||||
loginModeIntro: "Die Zukunft deines Stils",
|
||||
@@ -843,5 +855,8 @@ export const translations = {
|
||||
themeColorTitle: "Themenfarbe",
|
||||
personalizeColorDesc: "Farbe anpassen",
|
||||
saveChanges: "Änderungen Speichern",
|
||||
pasteLink: "Link Einfügen",
|
||||
pasteSharedLookLink: "Fügen Sie den Link zum geteilten Look ein:",
|
||||
invalidSharedLink: "Ungültiger Link. Stellen Sie sicher, dass Sie den vollständigen Link kopiert haben.",
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user