Skip to content

Commit

Permalink
Fix additional warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
leonw00 committed Mar 3, 2024
1 parent 88b92d8 commit aab2e64
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
17 changes: 10 additions & 7 deletions client/src/app/[locale]/(components)/(extra)/CountryMap.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect } from "react";
import "leaflet/dist/leaflet.css";
import L from "leaflet";

interface CountryMapProps {
width?: string;
Expand All @@ -12,13 +11,17 @@ const CountryMap: React.FC<CountryMapProps> = ({
height = "100%",
}) => {
useEffect(() => {
// Create a Leaflet map
const map = L.map("map").setView([51.505, -0.09], 13);
if (typeof window !== "undefined") {
import("leaflet").then((L) => {
// Create a Leaflet map
const map = L.map("map").setView([51.505, -0.09], 13);

// Add a tile layer to the map
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: "© OpenStreetMap contributors",
}).addTo(map);
// Add a tile layer to the map
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: "© OpenStreetMap contributors",
}).addTo(map);
});
}
}, []); // Empty dependency array ensures useEffect runs once

return <div id="map" style={{ width, height }} />;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import { List, Divider } from "@mui/material";

// ICONS
Expand All @@ -6,11 +7,13 @@ import DayTransactions from "./DayTransactions";
const AllTransactions = () => {
return (
<List>
{daysList.map((value) => (
<>
{daysList.map((value, index) => (
<React.Fragment key={index}>
<DayTransactions title={value} />
<Divider variant="fullWidth" component="li" />
</>
{index < daysList.length - 1 && (
<Divider variant="fullWidth" component="li" key={`divider-${index}`} />
)}
</React.Fragment>
))}
</List>
);
Expand Down

0 comments on commit aab2e64

Please sign in to comment.