Moving fils around

This commit is contained in:
vdv committed 2022-11-02 15:29:13 +01:00
1 parent 61fc42b251
commit 8e78fbc7ec
3 files changed
+2 -1

No files matched your search

-6
View File
@@ -1,6 +0,0 @@
ion-button.get-location {
--opacity: 0.6;
--ion-background-color: white;
margin-left: calc(50% - 20px);
}
-40
View File
@@ -1,40 +0,0 @@
import React from 'react';
import { Geolocation } from '@awesome-cordova-plugins/geolocation';
import './GetLocation.css';
import { IonButton, IonIcon } from '@ionic/react';
import { locateOutline } from 'ionicons/icons';
import { useAtom } from 'jotai';
import { setCenterAtom } from '../../App';
const GetLocation: React.FC<{}> = () => {
const [, setCenter] = useAtom(setCenterAtom);
const onClickHandler = (event: any) => {
console.log('Click handler');
Geolocation.getCurrentPosition().then((position) => {
console.log(
`Click handler, position: ${position.coords.latitude}, ${position.coords.longitude}`
);
setCenter({
lat: position.coords.latitude,
lon: position.coords.longitude,
});
});
};
return (
<IonButton
onClick={onClickHandler}
className='get-location get-position'
shape='round'
size='small'
fill='solid'
>
<IonIcon slot='icon-only' icon={locateOutline} color='white' />
</IonButton>
);
};
export default GetLocation;