-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Thomas Schley <thomas.schley@lmis.de>
- Loading branch information
Showing
14 changed files
with
316 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,7 @@ p { | |
margin-block-start: 0; | ||
margin-block-end: 0; | ||
} | ||
|
||
h1 { | ||
margin-block-start: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.breadcrumbs { | ||
background-color: #41485A; | ||
display: flex; | ||
padding: 10px min(4vh, 2vw); | ||
a { | ||
color: white; | ||
font-size: large; | ||
text-decoration: none; | ||
& + &:before { | ||
content: '>'; | ||
font-weight: normal; | ||
margin: 0 15px; | ||
} | ||
&.active { | ||
font-weight: bold; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {NavLink, useLocation} from 'react-router'; | ||
import styles from './Breadcrumbs.module.css'; | ||
|
||
const routeLabels: { [key: string]: string } = { | ||
impressum: 'Impressum' | ||
}; | ||
|
||
function Breadcrumbs() { | ||
const location = useLocation(); | ||
const pathnames = location.pathname.split('/').filter((x) => x); | ||
return ( | ||
<nav aria-label="breadcrumb" className={styles.breadcrumbs}> | ||
<NavLink | ||
to="/" | ||
className={({ isActive }) => (isActive ? styles.active : undefined)}> | ||
Startseite | ||
</NavLink> | ||
{pathnames.map((pathname, index) => { | ||
const to = `/${pathnames.slice(0, index + 1).join('/')}`; | ||
const label: string = routeLabels[pathname] || pathname; | ||
return <NavLink | ||
to={to} | ||
className={({ isActive }) => (isActive ? styles.active : undefined)}> | ||
{decodeURIComponent(label)} | ||
</NavLink>; | ||
})} | ||
</nav> | ||
); | ||
} | ||
|
||
export default Breadcrumbs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.map { | ||
height: 100%; | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { useEffect } from 'react'; | ||
|
||
import TileLayer from 'ol/layer/Tile'; | ||
import { OSM } from 'ol/source'; | ||
import { Map, View } from 'ol'; | ||
|
||
import 'ol/ol.css'; | ||
import styles from './OpenLayers.module.css'; | ||
|
||
interface Props { | ||
id: string | ||
} | ||
|
||
function OpenLayers({ id }: Props) { | ||
useEffect(() => { | ||
const osmLayer = new TileLayer({ | ||
preload: Infinity, | ||
source: new OSM(), | ||
}) | ||
|
||
const map = new Map({ | ||
target: id, | ||
layers: [ osmLayer ], | ||
view: new View({ | ||
center: [0, 0], | ||
zoom: 0, | ||
}), | ||
}); | ||
return () => map.setTarget(undefined) | ||
}); | ||
|
||
return <div id={id} className={styles.map}></div>; | ||
} | ||
|
||
export default OpenLayers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
} | ||
|
||
.content { | ||
padding: 40px; | ||
padding: min(4vh, 2vw); | ||
flex-grow: 1; | ||
overflow-y: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import {route, RouteConfig} from '@react-router/dev/routes'; | ||
import {index, route, RouteConfig} from '@react-router/dev/routes'; | ||
|
||
export default [ | ||
index('./routes/Home.tsx'), | ||
route('impressum', './routes/Impressum.tsx') | ||
] satisfies RouteConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.container { | ||
display: flex; | ||
@media only screen and (max-width: 767px) { | ||
flex-wrap: wrap; | ||
} | ||
height: 100%; | ||
.filter, .map { | ||
width: 50%; | ||
@media only screen and (max-width: 767px) { | ||
width: 100%; | ||
} | ||
} | ||
.filter { | ||
padding-right: 10px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import styles from './Home.module.css'; | ||
import OpenLayers from '../components/OpenLayers'; | ||
|
||
function Home() { | ||
return ( | ||
<div className={styles.container}> | ||
<div className={styles.filter}> | ||
<p>Placeholder for filters</p> | ||
</div> | ||
<div className={styles.map}> | ||
<OpenLayers id="geo_server" /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Home; |
Oops, something went wrong.