Adding a few files which are currently not used before a huge refactoring...

This commit is contained in:
Eric van der Vlist 2022-10-17 09:41:27 +02:00
parent ce074b5d22
commit ed951208e8
3 changed files with 87 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import react, { Fragment } from 'react';
interface FormProps {
context: any;
validate: (ctx: any) => {};
}
const Form: react.FC<{}> = () => {
return <Fragment />;
};
export default Form;

View File

@ -0,0 +1,50 @@
import LocalizedStrings from 'react-localization';
import { stopRecursion } from 'localized-strings/lib/StopRecursion';
const strings = new LocalizedStrings({
en: {
internationalTileProviders: {
osm: {
name: 'Open Street Map',
},
otm: {
name: 'Open Topo Map',
},
CyclOSM: {
name: 'CyclOSM',
title: 'CyclOSM: OpenStreetMap-based bicycle map',
description: (
<>
<p>
<a href='https://github.com/cyclosm/cyclosm-cartocss-style/'>
CyclOSM
</a>{' '}
is a bicycle-oriented map built on top of{' '}
<a href='https://www.openstreetmap.org/'>OpenStreetMap</a> data.
It aims at providing a beautiful and practical map for cyclists,
no matter their cycling habits or abilities.
</p>
<p>
In urban areas, it renders the main different types of cycle
tracks and lanes, on each side of the road, for helping you draw
your bike to work route. It also features essential POIs as well
as bicycle parking spots or spots shared with motorbikes, specific
infrastructure (elevators / ramps), road speeds or surfaces to
avoid streets with pavings, bumpers and bike boxes, etc.
</p>
<p>
The same map also lets you visualize main bicycle touring routes
as well as essential POIs when touring (emergency services,
shelters, tourism, shops).
</p>
</>
),
},
},
localizedTileProviders: stopRecursion({}),
},
fr: {},
});
export default strings;

25
src/lib/pubsub.ts Normal file
View File

@ -0,0 +1,25 @@
/**
*
* See https://www.pluralsight.com/guides/how-to-communicate-between-independent-components-in-reactjs (and many similar pages)
*
*
*/
const eventBus = {
on(event: string, callback: any) {
// ...
document.addEventListener(event, (e) => callback(e));
},
dispatch(event: string, data: any) {
// ...
document.dispatchEvent(new CustomEvent(event, { detail: data }));
},
remove(event: string, callback: (e: Event) => void) {
// ...
document.removeEventListener(event, callback);
},
};
export default eventBus;