Fix Nombre CABA
This commit is contained in:
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 821 B After Width: | Height: | Size: 821 B |
@@ -55,7 +55,7 @@ const formatDateTime = (dateString: string | undefined | null) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const HomeCarouselProvincialWidget = ({ eleccionId, categoriaId, titulo }: Props) => {
|
export const HomeCarouselProvincialWidget = ({ eleccionId, categoriaId, titulo }: Props) => {
|
||||||
const [selectedProvince, setSelectedProvince] = useState<OptionType | null>({ value: '01', label: 'Capital Federal' });
|
const [selectedProvince, setSelectedProvince] = useState<OptionType | null>({ value: '01', label: 'CABA' });
|
||||||
|
|
||||||
const { data: provincias = [], isLoading: isLoadingProvincias } = useQuery<CatalogoItem[]>({
|
const { data: provincias = [], isLoading: isLoadingProvincias } = useQuery<CatalogoItem[]>({
|
||||||
queryKey: ['provincias'],
|
queryKey: ['provincias'],
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ interface ViewConfig {
|
|||||||
const PROVINCE_VIEW_CONFIG: Record<string, { desktop: ViewConfig; mobile?: ViewConfig }> = {
|
const PROVINCE_VIEW_CONFIG: Record<string, { desktop: ViewConfig; mobile?: ViewConfig }> = {
|
||||||
"BUENOS AIRES": { desktop: { center: [-60.5, -37.3], zoom: 5 }, mobile: { center: [-60, -38], zoom: 5.5 } },
|
"BUENOS AIRES": { desktop: { center: [-60.5, -37.3], zoom: 5 }, mobile: { center: [-60, -38], zoom: 5.5 } },
|
||||||
"SANTA CRUZ": { desktop: { center: [-69.5, -49.3], zoom: 5 }, mobile: { center: [-69.5, -50], zoom: 4 } },
|
"SANTA CRUZ": { desktop: { center: [-69.5, -49.3], zoom: 5 }, mobile: { center: [-69.5, -50], zoom: 4 } },
|
||||||
"CAPITAL FEDERAL": { desktop: { center: [-58.44, -34.65], zoom: 150 } },
|
"CABA": { desktop: { center: [-58.44, -34.65], zoom: 150 } },
|
||||||
"CHUBUT": { desktop: { center: [-68.5, -44.5], zoom: 5.5 }, mobile: { center: [-68, -44.5], zoom: 4.5 } },
|
"CHUBUT": { desktop: { center: [-68.5, -44.5], zoom: 5.5 }, mobile: { center: [-68, -44.5], zoom: 4.5 } },
|
||||||
"SANTA FE": { desktop: { center: [-61, -31.2], zoom: 6 }, mobile: { center: [-61, -31.5], zoom: 7.5 } },
|
"SANTA FE": { desktop: { center: [-61, -31.2], zoom: 6 }, mobile: { center: [-61, -31.5], zoom: 7.5 } },
|
||||||
"CORRIENTES": { desktop: { center: [-58, -29], zoom: 7 }, mobile: { center: [-57.5, -28.8], zoom: 9 } },
|
"CORRIENTES": { desktop: { center: [-58, -29], zoom: 7 }, mobile: { center: [-57.5, -28.8], zoom: 9 } },
|
||||||
@@ -278,7 +278,7 @@ export const MapaNacional = ({ eleccionId, categoriaId, nivel, nombreAmbito, nom
|
|||||||
<Geographies geography={geoDataNacional}>
|
<Geographies geography={geoDataNacional}>
|
||||||
{({ geographies }: { geographies: AmbitoGeography[] }) => geographies.map((geo) => {
|
{({ geographies }: { geographies: AmbitoGeography[] }) => geographies.map((geo) => {
|
||||||
const nombreNormalizado = normalizarTexto(geo.properties.nombre);
|
const nombreNormalizado = normalizarTexto(geo.properties.nombre);
|
||||||
const esCABA = nombreNormalizado === 'CAPITAL FEDERAL';
|
const esCABA = nombreNormalizado === 'CABA';
|
||||||
const resultado = resultadosNacionalesPorNombre.get(nombreNormalizado);
|
const resultado = resultadosNacionalesPorNombre.get(nombreNormalizado);
|
||||||
const esProvinciaActiva = provinciaDistritoId && resultado?.ambitoId === provinciaDistritoId;
|
const esProvinciaActiva = provinciaDistritoId && resultado?.ambitoId === provinciaDistritoId;
|
||||||
|
|
||||||
@@ -321,7 +321,7 @@ export const MapaNacional = ({ eleccionId, categoriaId, nivel, nombreAmbito, nom
|
|||||||
{nivel === 'pais' && (
|
{nivel === 'pais' && (
|
||||||
<div id="caba-lupa-anchor" className={styles.cabaMagnifierContainer} style={lupaStyle} ref={lupaRef}>
|
<div id="caba-lupa-anchor" className={styles.cabaMagnifierContainer} style={lupaStyle} ref={lupaRef}>
|
||||||
{(() => {
|
{(() => {
|
||||||
const resultadoCABA = resultadosNacionalesPorNombre.get("CAPITAL FEDERAL");
|
const resultadoCABA = resultadosNacionalesPorNombre.get("CABA");
|
||||||
const fillColor = resultadoCABA?.colorGanador || DEFAULT_MAP_COLOR;
|
const fillColor = resultadoCABA?.colorGanador || DEFAULT_MAP_COLOR;
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
if (resultadoCABA) {
|
if (resultadoCABA) {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export const MapaProvincial = ({ eleccionId, categoriaId, distritoId, nombreProv
|
|||||||
if (municipioGeo) {
|
if (municipioGeo) {
|
||||||
const municipioFeature = feature(geoData, municipioGeo);
|
const municipioFeature = feature(geoData, municipioGeo);
|
||||||
const centroid = geoCentroid(municipioFeature);
|
const centroid = geoCentroid(municipioFeature);
|
||||||
if (nombreProvincia.toUpperCase() === 'CAPITAL FEDERAL') {
|
if (nombreProvincia.toUpperCase() === 'CABA') {
|
||||||
onCalculatedCenter(centroid as PointTuple, 180);
|
onCalculatedCenter(centroid as PointTuple, 180);
|
||||||
} else {
|
} else {
|
||||||
onCalculatedCenter(centroid as PointTuple, 10);
|
onCalculatedCenter(centroid as PointTuple, 10);
|
||||||
@@ -60,7 +60,7 @@ export const MapaProvincial = ({ eleccionId, categoriaId, distritoId, nombreProv
|
|||||||
}, [nivel, nombreMunicipioSeleccionado, geoData, onCalculatedCenter]);
|
}, [nivel, nombreMunicipioSeleccionado, geoData, onCalculatedCenter]);
|
||||||
|
|
||||||
const resultadosPorNombre = new Map<string, ResultadoMapaDto>(mapaData.map(d => [normalizarTexto(d.ambitoNombre), d]));
|
const resultadosPorNombre = new Map<string, ResultadoMapaDto>(mapaData.map(d => [normalizarTexto(d.ambitoNombre), d]));
|
||||||
const esCABA = normalizarTexto(nombreProvincia) === "CAPITAL FEDERAL";
|
const esCABA = normalizarTexto(nombreProvincia) === "CABA";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Geographies geography={geoData}>
|
<Geographies geography={geoData}>
|
||||||
|
|||||||
Reference in New Issue
Block a user