diff options
Diffstat (limited to 'src/components/TileLayerControl/TileLayerControl.tsx')
| -rw-r--r-- | src/components/TileLayerControl/TileLayerControl.tsx | 21 | 
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>
 +  );
 +}
 |