From 66ea332918ef47bbdc53f4b6912b2b4ac81a5ab9 Mon Sep 17 00:00:00 2001 From: Alexander Gabriel Date: Fri, 14 Jul 2023 16:30:50 +0200 Subject: [PATCH] remove unused --- .../Projekte/Karte/FullscreenControl.jsx | 18 ++++++++---------- .../Projekte/Karte/iconFullscreen.png | Bin 139 -> 0 bytes .../Projekte/Karte/iconFullscreen2x.png | Bin 215 -> 0 bytes src/components/Projekte/Karte/index.jsx | 15 --------------- 4 files changed, 8 insertions(+), 25 deletions(-) delete mode 100644 src/components/Projekte/Karte/iconFullscreen.png delete mode 100644 src/components/Projekte/Karte/iconFullscreen2x.png diff --git a/src/components/Projekte/Karte/FullscreenControl.jsx b/src/components/Projekte/Karte/FullscreenControl.jsx index 685ebadd3..084a581e9 100644 --- a/src/components/Projekte/Karte/FullscreenControl.jsx +++ b/src/components/Projekte/Karte/FullscreenControl.jsx @@ -1,10 +1,9 @@ import React, { useCallback, useEffect, useState } from 'react' -import 'leaflet' import styled from '@emotion/styled' import { FaExpandArrowsAlt, FaCompressArrowsAlt } from 'react-icons/fa' import screenfull from 'screenfull' -const StyledButton = styled.button` +const Button = styled.button` background-color: white; width: 34px; height: 34px; @@ -23,29 +22,28 @@ const StyledButton = styled.button` const FullscreenControl = ({ mapRef }) => { const [isFullscreen, setIsFullscreen] = useState(false) - const onChange = useCallback( + const onFullscreenChange = useCallback( () => setIsFullscreen(screenfull.isFullscreen), [], ) useEffect(() => { - screenfull.on('change', onChange) - - return () => screenfull.off('change', onChange) - }, [onChange]) + screenfull.on('change', onFullscreenChange) + return () => screenfull.off('change', onFullscreenChange) + }, [onFullscreenChange]) const onClick = useCallback(() => { if (screenfull.isEnabled) { - screenfull?.toggle?.(mapRef.current) + screenfull.toggle(mapRef.current) } }, [mapRef]) return ( - {isFullscreen ? : } - + ) } diff --git a/src/components/Projekte/Karte/iconFullscreen.png b/src/components/Projekte/Karte/iconFullscreen.png deleted file mode 100644 index 8ee244724d9910a51bbc2d96e9a9ae32f215ba58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI10wkH8TU>!ukf)1dNCji^0x1dB{|7(Vbls@z z&`|W{(@5ewlDVs2scim)WuJNY99-EnlGq#s*%$CIUSKd0XO#Bf;A4>yo5jJ-^3>7K lqDa%H!S~2LIiO4_{0&ssx(O;OXk;vd$@?2>|-4B<27B diff --git a/src/components/Projekte/Karte/iconFullscreen2x.png b/src/components/Projekte/Karte/iconFullscreen2x.png deleted file mode 100644 index efc0dfbe88abebfca73e6b8f85d394b18ed50906..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 215 zcmV;|04V>7P)O)1TqPTnLVqF#wv#GSWq1n8%slbs`HBHZ?sS2cOdO4)3 zT@^K9Om76kB8$NC<`?WoZbAH}${!OSb@1^=Ie$6%hU*r8f#k2me~dB4%mAHFdkApa RWdi^J002ovPDHLkV1k|JSg8O2 diff --git a/src/components/Projekte/Karte/index.jsx b/src/components/Projekte/Karte/index.jsx index 3bcf7c084..f257d3eff 100644 --- a/src/components/Projekte/Karte/index.jsx +++ b/src/components/Projekte/Karte/index.jsx @@ -61,8 +61,6 @@ import DrawControl from './DrawControl' import PrintControl from './PrintControl' import OwnControls from './OwnControls' import CoordinatesControl from './CoordinatesControl' -import iconFullscreen from './iconFullscreen.png' -import iconFullscreen2x from './iconFullscreen2x.png' import ErrorBoundary from '../../shared/ErrorBoundary' import MapFilterListener from './MapFilterListener' import ClickListener from './ClickListener' @@ -361,19 +359,6 @@ const StyledMapContainer = styled(MapContainer)` background: rgba(255, 255, 255, 0.9) !important; } - /* - * leaflet.fullscreen - */ - - .fullscreen-icon { - background-image: url(${iconFullscreen}); - } - - .leaflet-retina .fullscreen-icon { - background-image: url(${iconFullscreen2x}); - background-size: 26px 26px; - } - /* one selector per rule as explained here : https://www.sitepoint.com/html5-full-screen-api/ */ .leaflet-container:-webkit-full-screen {