From f2ecc1803f3ea294a0c6b7915b61348ed0395b26 Mon Sep 17 00:00:00 2001
From: Marcin Zelent <marcin@zelent.net>
Date: Wed, 16 Nov 2022 15:16:38 +0100
Subject: Remade and extended the app using React

---
 .../TileLayerControl/TileLayerControl.tsx           | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 src/components/TileLayerControl/TileLayerControl.tsx

(limited to 'src/components/TileLayerControl/TileLayerControl.tsx')

diff --git a/src/components/TileLayerControl/TileLayerControl.tsx b/src/components/TileLayerControl/TileLayerControl.tsx
new file mode 100644
index 0000000..026ade1
--- /dev/null
+++ b/src/components/TileLayerControl/TileLayerControl.tsx
@@ -0,0 +1,21 @@
+import React from 'react';
+import styles from './TileLayerControl.module.css';
+
+export enum TileLayerType {
+  map,
+  satellite,
+}
+
+interface Props {
+  tileType: TileLayerType;
+  onClick: () => void;
+}
+
+export default function TileLayerControl({ tileType, onClick }: Props): JSX.Element {
+  const bgClass = tileType === TileLayerType.map ? styles.satellite : styles.map;
+  return (
+    <div className={`${styles.tileLayerControl} leaflet-bar`}>
+      <button type="button" className={bgClass} onClick={onClick}></button>
+    </div>
+  );
+}
-- 
cgit v1.2.3

