aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Zelent <marcin@zelent.net>2022-11-16 15:16:38 +0100
committerMarcin Zelent <marcin@zelent.net>2022-11-16 15:16:38 +0100
commitf2ecc1803f3ea294a0c6b7915b61348ed0395b26 (patch)
treee8c6fb1350ae4f659b3f9ef8d17157158b974b16 /src/components/TileLayerControl/TileLayerControl.tsx
parentefb64f24d6200a39870c0e8966ab4f87e07c93a9 (diff)
Remade and extended the app using React
Diffstat (limited to 'src/components/TileLayerControl/TileLayerControl.tsx')
-rw-r--r--src/components/TileLayerControl/TileLayerControl.tsx21
1 files changed, 21 insertions, 0 deletions
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>
+ );
+}