Fix Widgets Home y Logos Overrides
This commit is contained in:
@@ -53,6 +53,7 @@ export const LogoOverridesManager = () => {
|
|||||||
const currentLogo = useMemo(() => {
|
const currentLogo = useMemo(() => {
|
||||||
if (!selectedAgrupacion || !selectedCategoria) return '';
|
if (!selectedAgrupacion || !selectedCategoria) return '';
|
||||||
const ambitoId = getAmbitoId();
|
const ambitoId = getAmbitoId();
|
||||||
|
|
||||||
return logos.find(l =>
|
return logos.find(l =>
|
||||||
l.eleccionId === selectedEleccion.value &&
|
l.eleccionId === selectedEleccion.value &&
|
||||||
l.ambitoGeograficoId === ambitoId &&
|
l.ambitoGeograficoId === ambitoId &&
|
||||||
@@ -64,7 +65,10 @@ export const LogoOverridesManager = () => {
|
|||||||
useEffect(() => { setLogoUrl(currentLogo || ''); }, [currentLogo]);
|
useEffect(() => { setLogoUrl(currentLogo || ''); }, [currentLogo]);
|
||||||
|
|
||||||
const handleSave = async () => {
|
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 = {
|
const newLogoEntry: LogoAgrupacionCategoria = {
|
||||||
id: 0,
|
id: 0,
|
||||||
eleccionId: selectedEleccion.value,
|
eleccionId: selectedEleccion.value,
|
||||||
|
|||||||
@@ -57,28 +57,6 @@ export const HomeCarouselNacionalWidget = ({ eleccionId, categoriaId, titulo }:
|
|||||||
<div className={styles.homeCarouselWidget}>
|
<div className={styles.homeCarouselWidget}>
|
||||||
<h2 className={styles.widgetTitle}>{titulo}</h2>
|
<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}>
|
<div className={styles.carouselContainer}>
|
||||||
<Swiper
|
<Swiper
|
||||||
modules={[Navigation, A11y]}
|
modules={[Navigation, A11y]}
|
||||||
@@ -132,6 +110,28 @@ export const HomeCarouselNacionalWidget = ({ eleccionId, categoriaId, titulo }:
|
|||||||
<div className={`${styles.navButton} ${styles.navButtonNext} ${nextButtonClass}`}></div>
|
<div className={`${styles.navButton} ${styles.navButtonNext} ${nextButtonClass}`}></div>
|
||||||
</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}>
|
<div className={styles.widgetFooter}>
|
||||||
Última actualización: {formatDateTime(data.ultimaActualizacion)}
|
Última actualización: {formatDateTime(data.ultimaActualizacion)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 0.3rem 0.5rem;
|
padding: 0.3rem 0.5rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
|
margin-top: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.topStatsBar > div {
|
.topStatsBar > div {
|
||||||
@@ -176,7 +177,7 @@
|
|||||||
|
|
||||||
/* Posición y contenido específico para cada botón */
|
/* Posición y contenido específico para cada botón */
|
||||||
.navButtonPrev {
|
.navButtonPrev {
|
||||||
left: 10px;
|
left: -10px;
|
||||||
}
|
}
|
||||||
.navButtonPrev::after {
|
.navButtonPrev::after {
|
||||||
/* SVG de flecha izquierda (chevron) codificado en Base64 */
|
/* SVG de flecha izquierda (chevron) codificado en Base64 */
|
||||||
@@ -184,7 +185,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.navButtonNext {
|
.navButtonNext {
|
||||||
right: 10px;
|
right: -10px;
|
||||||
}
|
}
|
||||||
.navButtonNext::after {
|
.navButtonNext::after {
|
||||||
/* SVG de flecha derecha (chevron) codificado en Base64 */
|
/* SVG de flecha derecha (chevron) codificado en Base64 */
|
||||||
@@ -278,8 +279,8 @@
|
|||||||
.navButton::after {
|
.navButton::after {
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
}
|
}
|
||||||
.navButtonPrev { left: 5px; }
|
.navButtonPrev { left: -10px; }
|
||||||
.navButtonNext { right: 5px; }
|
.navButtonNext { right: -10px; }
|
||||||
|
|
||||||
.homeCarouselWidget .candidateCard { gap: 0.5rem; padding: 0.5rem; }
|
.homeCarouselWidget .candidateCard { gap: 0.5rem; padding: 0.5rem; }
|
||||||
.homeCarouselWidget .candidatePhotoWrapper { width: 50px; height: 50px; }
|
.homeCarouselWidget .candidatePhotoWrapper { width: 50px; height: 50px; }
|
||||||
|
|||||||
@@ -58,28 +58,6 @@ export const HomeCarouselWidget = ({ eleccionId, distritoId, categoriaId, titulo
|
|||||||
<div className={styles.homeCarouselWidget}>
|
<div className={styles.homeCarouselWidget}>
|
||||||
<h2 className={styles.widgetTitle}>{titulo}</h2>
|
<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}>
|
<div className={styles.carouselContainer}>
|
||||||
<Swiper
|
<Swiper
|
||||||
modules={[Navigation, A11y]}
|
modules={[Navigation, A11y]}
|
||||||
@@ -133,6 +111,28 @@ export const HomeCarouselWidget = ({ eleccionId, distritoId, categoriaId, titulo
|
|||||||
<div className={`${styles.navButton} ${styles.navButtonNext} ${nextButtonClass}`}></div>
|
<div className={`${styles.navButton} ${styles.navButtonNext} ${nextButtonClass}`}></div>
|
||||||
</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}>
|
<div className={styles.widgetFooter}>
|
||||||
Última actualización: {formatDateTime(data.ultimaActualizacion)}
|
Última actualización: {formatDateTime(data.ultimaActualizacion)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Api")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Api")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[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.AssemblyProductAttribute("Elecciones.Api")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Api")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Api")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
Reference in New Issue
Block a user