diff --git a/src/App.jsx b/src/App.jsx index 2ac121b..439fd48 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -537,7 +537,11 @@ export default function App() { createdAt: new Date().getTime(), }); - const shareUrl = `${window.location.origin}${window.location.pathname}?shared=${docRef.id}`; + // Força o uso do domínio oficial se estiver em localhost (para os links de partilha funcionarem) + const baseUrl = (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') + ? 'https://mycloset.epvc.pt' + : window.location.origin; + const shareUrl = `${baseUrl}${window.location.pathname}?shared=${docRef.id}`; await navigator.clipboard.writeText(shareUrl); setCopiedLookId(look.id); setTimeout(() => setCopiedLookId(null), 3000); @@ -1210,9 +1214,17 @@ export default function App() {
{(() => { - const filteredBySectionLooks = looks.filter(look => - activeSectionFilter === 'all' || (look.sections && look.sections.includes(activeSectionFilter)) - ); + const filteredBySectionLooks = looks.filter(look => { + const matchesSection = activeSectionFilter === 'all' || (look.sections && look.sections.includes(activeSectionFilter)); + let matchesColor = true; + if (colorFilter) { + matchesColor = look.items.some(id => { + const item = clothes.find(c => c.id === id); + return item && item.color && item.color.includes(colorFilter); + }); + } + return matchesSection && matchesColor; + }); const availableLooks = filteredBySectionLooks.filter(look => look.items.every(id => { @@ -1279,6 +1291,18 @@ export default function App() {

)} + {look.sections && look.sections.length > 0 && ( +
+ {look.sections.map(secId => { + const sec = sections.find(s => s.id === secId); + return sec ? ( + + {sec.emoji} {sec.name} + + ) : null; + })} +
+ )} ); }; @@ -1287,9 +1311,22 @@ export default function App() { <> {/* Looks disponíveis */}
-
-
-

{t('lookHistory')} — {t('availableLooks')} ({availableLooks.length})

+
+
+
+

{t('lookHistory')} — {t('availableLooks')} ({availableLooks.length})

+
+
+ + +
{availableLooks.length > 0 ? (