Fix Widgets Home y Logos Overrides

This commit is contained in:
2025-10-23 10:51:50 -03:00
parent 814b24cefb
commit 3c364ef373
5 changed files with 55 additions and 50 deletions

View File

@@ -53,6 +53,7 @@ export const LogoOverridesManager = () => {
const currentLogo = useMemo(() => {
if (!selectedAgrupacion || !selectedCategoria) return '';
const ambitoId = getAmbitoId();
return logos.find(l =>
l.eleccionId === selectedEleccion.value &&
l.ambitoGeograficoId === ambitoId &&
@@ -64,7 +65,10 @@ export const LogoOverridesManager = () => {
useEffect(() => { setLogoUrl(currentLogo || ''); }, [currentLogo]);
const handleSave = async () => {
if (!selectedAgrupacion || !selectedCategoria) return;
if (!selectedAgrupacion || !selectedCategoria) {
alert("Por favor, seleccione una agrupación y una categoría.");
return;
}
const newLogoEntry: LogoAgrupacionCategoria = {
id: 0,
eleccionId: selectedEleccion.value,

View File

@@ -57,28 +57,6 @@ export const HomeCarouselNacionalWidget = ({ eleccionId, categoriaId, titulo }:
<div className={styles.homeCarouselWidget}>
<h2 className={styles.widgetTitle}>{titulo}</h2>
<div className={styles.topStatsBar}>
<div>
<span>Participación</span>
<strong>{formatPercent(data.estadoRecuento?.participacionPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Mesas escrutadas</span>
<span className={styles.shortText}>Escrutado</span>
<strong>{formatPercent(data.estadoRecuento?.mesasTotalizadasPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Votos en blanco</span>
<span className={styles.shortText}>En blanco</span>
<strong>{formatPercent(data.votosEnBlancoPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Votos totales</span>
<span className={styles.shortText}>Votos</span>
<strong>{formatNumber(data.votosTotales)}</strong>
</div>
</div>
<div className={styles.carouselContainer}>
<Swiper
modules={[Navigation, A11y]}
@@ -132,6 +110,28 @@ export const HomeCarouselNacionalWidget = ({ eleccionId, categoriaId, titulo }:
<div className={`${styles.navButton} ${styles.navButtonNext} ${nextButtonClass}`}></div>
</div>
<div className={styles.topStatsBar}>
<div>
<span>Participación</span>
<strong>{formatPercent(data.estadoRecuento?.participacionPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Mesas escrutadas</span>
<span className={styles.shortText}>Escrutado</span>
<strong>{formatPercent(data.estadoRecuento?.mesasTotalizadasPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Votos en blanco</span>
<span className={styles.shortText}>En blanco</span>
<strong>{formatPercent(data.votosEnBlancoPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Votos totales</span>
<span className={styles.shortText}>Votos</span>
<strong>{formatNumber(data.votosTotales)}</strong>
</div>
</div>
<div className={styles.widgetFooter}>
Última actualización: {formatDateTime(data.ultimaActualizacion)}
</div>

View File

@@ -48,6 +48,7 @@
border-radius: 8px;
padding: 0.3rem 0.5rem;
margin-bottom: 0.5rem;
margin-top: 0.5rem;
}
.topStatsBar > div {
@@ -176,7 +177,7 @@
/* Posición y contenido específico para cada botón */
.navButtonPrev {
left: 10px;
left: -10px;
}
.navButtonPrev::after {
/* SVG de flecha izquierda (chevron) codificado en Base64 */
@@ -184,7 +185,7 @@
}
.navButtonNext {
right: 10px;
right: -10px;
}
.navButtonNext::after {
/* SVG de flecha derecha (chevron) codificado en Base64 */
@@ -278,8 +279,8 @@
.navButton::after {
line-height: 32px;
}
.navButtonPrev { left: 5px; }
.navButtonNext { right: 5px; }
.navButtonPrev { left: -10px; }
.navButtonNext { right: -10px; }
.homeCarouselWidget .candidateCard { gap: 0.5rem; padding: 0.5rem; }
.homeCarouselWidget .candidatePhotoWrapper { width: 50px; height: 50px; }

View File

@@ -58,28 +58,6 @@ export const HomeCarouselWidget = ({ eleccionId, distritoId, categoriaId, titulo
<div className={styles.homeCarouselWidget}>
<h2 className={styles.widgetTitle}>{titulo}</h2>
<div className={styles.topStatsBar}>
<div>
<span>Participación</span>
<strong>{formatPercent(data.estadoRecuento?.participacionPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Mesas escrutadas</span>
<span className={styles.shortText}>Escrutado</span>
<strong>{formatPercent(data.estadoRecuento?.mesasTotalizadasPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Votos en blanco</span>
<span className={styles.shortText}>En blanco</span>
<strong>{formatPercent(data.votosEnBlancoPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Votos totales</span>
<span className={styles.shortText}>Votos</span>
<strong>{formatNumber(data.votosTotales)}</strong>
</div>
</div>
<div className={styles.carouselContainer}>
<Swiper
modules={[Navigation, A11y]}
@@ -133,6 +111,28 @@ export const HomeCarouselWidget = ({ eleccionId, distritoId, categoriaId, titulo
<div className={`${styles.navButton} ${styles.navButtonNext} ${nextButtonClass}`}></div>
</div>
<div className={styles.topStatsBar}>
<div>
<span>Participación</span>
<strong>{formatPercent(data.estadoRecuento?.participacionPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Mesas escrutadas</span>
<span className={styles.shortText}>Escrutado</span>
<strong>{formatPercent(data.estadoRecuento?.mesasTotalizadasPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Votos en blanco</span>
<span className={styles.shortText}>En blanco</span>
<strong>{formatPercent(data.votosEnBlancoPorcentaje)}</strong>
</div>
<div>
<span className={styles.longText}>Votos totales</span>
<span className={styles.shortText}>Votos</span>
<strong>{formatNumber(data.votosTotales)}</strong>
</div>
</div>
<div className={styles.widgetFooter}>
Última actualización: {formatDateTime(data.ultimaActualizacion)}
</div>

View File

@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Api")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0ee092d6edd7454ee43318dc4c7e3d6f5348bff1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+814b24cefbaf491f4b43e55a0ded7431f679486d")]
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Api")]
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Api")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]