Back/Forward buttons
This commit is contained in:
parent
8e78fbc7ec
commit
925174db79
|
@ -34,6 +34,8 @@ import { MapScope } from './components/map/types';
|
||||||
import { debounce } from 'lodash';
|
import { debounce } from 'lodash';
|
||||||
import GetLocation from './components/buttons/GetLocation';
|
import GetLocation from './components/buttons/GetLocation';
|
||||||
import { geoPoint } from './components/map/types';
|
import { geoPoint } from './components/map/types';
|
||||||
|
import Back from './components/buttons/Back';
|
||||||
|
import Forward from './components/buttons/Forward';
|
||||||
|
|
||||||
setupIonicReact();
|
setupIonicReact();
|
||||||
|
|
||||||
|
@ -73,7 +75,10 @@ const App: React.FC = () => {
|
||||||
</IonContent>
|
</IonContent>
|
||||||
<IonHeader className='ion-no-border' translucent={true}>
|
<IonHeader className='ion-no-border' translucent={true}>
|
||||||
<IonToolbar>
|
<IonToolbar>
|
||||||
<IonButtons slot='start'></IonButtons>
|
<IonButtons slot='start'>
|
||||||
|
<Back />
|
||||||
|
<Forward />
|
||||||
|
</IonButtons>
|
||||||
<IonButtons slot='end'></IonButtons>
|
<IonButtons slot='end'></IonButtons>
|
||||||
</IonToolbar>
|
</IonToolbar>
|
||||||
</IonHeader>
|
</IonHeader>
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
import react from 'react';
|
||||||
|
import { IonButton, IonIcon } from '@ionic/react';
|
||||||
|
import { arrowBackCircleOutline } from 'ionicons/icons';
|
||||||
|
import './BackForward.css';
|
||||||
|
|
||||||
|
export interface BackProperties {}
|
||||||
|
|
||||||
|
export const Back: react.FC<BackProperties> = (props: BackProperties) => {
|
||||||
|
const onClickHandler = (event: any) => {
|
||||||
|
window.history.back();
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<IonButton
|
||||||
|
onClick={onClickHandler}
|
||||||
|
size='large'
|
||||||
|
className='back-forward'
|
||||||
|
shape='round'
|
||||||
|
fill='solid'
|
||||||
|
>
|
||||||
|
<IonIcon slot='icon-only' icon={arrowBackCircleOutline} />
|
||||||
|
</IonButton>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Back;
|
|
@ -0,0 +1,5 @@
|
||||||
|
ion-button.back-forward {
|
||||||
|
--opacity: 0.6;
|
||||||
|
--ion-background-color: white;
|
||||||
|
--ionicon-stroke-width: 48px;
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
import react from 'react';
|
||||||
|
import { IonButton, IonIcon } from '@ionic/react';
|
||||||
|
import { arrowForwardCircleOutline } from 'ionicons/icons';
|
||||||
|
import './BackForward.css';
|
||||||
|
|
||||||
|
export interface ForwardProperties {}
|
||||||
|
|
||||||
|
export const Forward: react.FC<ForwardProperties> = (props: ForwardProperties) => {
|
||||||
|
const onClickHandler = (event: any) => {
|
||||||
|
window.history.forward();
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<IonButton
|
||||||
|
onClick={onClickHandler}
|
||||||
|
size='large'
|
||||||
|
className='back-forward'
|
||||||
|
shape='round'
|
||||||
|
fill='solid'
|
||||||
|
>
|
||||||
|
<IonIcon slot='icon-only' icon={arrowForwardCircleOutline} />
|
||||||
|
</IonButton>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Forward;
|
Loading…
Reference in New Issue