Skip to content

Commit

Permalink
fix more ts
Browse files Browse the repository at this point in the history
  • Loading branch information
eloicasamayor committed Nov 14, 2024
1 parent cff0c3c commit 791b4e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-ignore
import { Map } from "./assets/world";
import "./App.css";
import { useEffect, useState } from "react";
Expand All @@ -8,11 +9,11 @@ function App() {
useEffect(() => {
let paths = document.querySelectorAll("path");
for (let i = 0; i < paths.length; i++) {
paths[i].addEventListener("click", onClickPais);
paths[i].addEventListener("click", (e) => onClickPais(e));
}
}, []);

function onClickPais(e: PointerEvent) {
function onClickPais(e: MouseEvent) {
const targ = e.target as SVGPathElement;
const title = (targ.attributes.getNamedItem("title") as Attr).value;

Expand Down
6 changes: 1 addition & 5 deletions src/assets/world.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
// @ts-nocheck
import React from "react";
export function Map() {
return (
<svg
className="map"
xmlns:mapsvg="http://mapsvg.com"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
mapsvg:geoViewBox="-169.110266 83.600842 190.486279 -58.508473"
width="100%"
viewBox="0 0 1000 1000"
>
Expand Down

0 comments on commit 791b4e7

Please sign in to comment.