Change switch icon

This commit is contained in:
KoalaSat 2023-10-15 09:09:24 +02:00 committed by Reckless_Satoshi
parent 871299b3bf
commit cb973a7f1f
2 changed files with 11 additions and 12 deletions

View File

@ -10,7 +10,7 @@ import {
Tooltip, Tooltip,
Grid, Grid,
} from '@mui/material'; } from '@mui/material';
import { WifiTetheringError } from '@mui/icons-material'; import { PhotoSizeSelectActual } from '@mui/icons-material';
import Map from '../Map'; import Map from '../Map';
import { LatLng } from 'leaflet'; import { LatLng } from 'leaflet';
@ -35,7 +35,7 @@ const F2fMapDialog = ({
}: Props): JSX.Element => { }: Props): JSX.Element => {
const { t } = useTranslation(); const { t } = useTranslation();
const [position, setPosition] = useState<LatLng>(); const [position, setPosition] = useState<LatLng>();
const [lowQuality, setLowQuality] = useState<boolean>(true); const [useTiles, setUseTiles] = useState<boolean>(false);
const onSave = () => { const onSave = () => {
onClose(position); onClose(position);
@ -75,10 +75,10 @@ const F2fMapDialog = ({
> >
<Switch <Switch
size='small' size='small'
checked={lowQuality} checked={useTiles}
onChange={() => setLowQuality((value) => !value)} onChange={() => setUseTiles((value) => !value)}
/> />
<WifiTetheringError sx={{ color: 'text.secondary' }} /> <PhotoSizeSelectActual sx={{ color: 'text.secondary' }} />
</div> </div>
</Tooltip> </Tooltip>
</Grid> </Grid>
@ -87,7 +87,7 @@ const F2fMapDialog = ({
<DialogContent style={{ height: '100vh', width: '80vw' }}> <DialogContent style={{ height: '100vh', width: '80vw' }}>
<Map <Map
orderType={orderType} orderType={orderType}
lowQuality={lowQuality} useTiles={useTiles}
position={position} position={position}
setPosition={setPosition} setPosition={setPosition}
zoom={zoom} zoom={zoom}

View File

@ -10,7 +10,7 @@ import OrderTooltip from '../Charts/helpers/OrderTooltip';
interface Props { interface Props {
orderType?: number; orderType?: number;
lowQuality: boolean; useTiles: boolean;
position?: LatLng | undefined; position?: LatLng | undefined;
setPosition?: (position: LatLng) => void; setPosition?: (position: LatLng) => void;
orders?: PublicOrder[]; orders?: PublicOrder[];
@ -25,7 +25,7 @@ const Map = ({
zoom, zoom,
orders = [], orders = [],
setPosition = () => {}, setPosition = () => {},
lowQuality = true, useTiles = false,
onOrderClicked = () => null, onOrderClicked = () => null,
center, center,
}: Props): JSX.Element => { }: Props): JSX.Element => {
@ -86,9 +86,8 @@ const Map = ({
zoom={zoom ? zoom : 2} zoom={zoom ? zoom : 2}
style={{ height: '100%', width: '100%' }} style={{ height: '100%', width: '100%' }}
> >
{lowQuality && !worldmap && <LinearProgress />} {!useTiles && !worldmap && <LinearProgress />}
<>{}</> {!useTiles && worldmap && (
{lowQuality && worldmap && (
<> <>
<GeoJSON <GeoJSON
data={worldmap} data={worldmap}
@ -101,7 +100,7 @@ const Map = ({
{getOrderMarkers()} {getOrderMarkers()}
</> </>
)} )}
{!lowQuality && ( {useTiles && (
<> <>
<TileLayer <TileLayer
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'