change vertical/horizontal split based on orientation/screensize

This commit is contained in:
Andreas Hubel 2023-09-24 21:42:52 +02:00
commit 67624586ed
4 changed files with 33 additions and 11 deletions

View file

@ -30,7 +30,7 @@ class Map extends React.Component {
<LeafletMap <LeafletMap
center={centerGermany} center={centerGermany}
zoom={5} zoom={5}
style={{ width: '100vw', height: 'calc(50vh - 60px)', margin: 0, padding: 0, maxWidth: '100%' }} style={{ margin: 0, padding: 0, height: '100%', width: '100%', maxWidth: '100%' }}
> >
<TileLayer <TileLayer
url="/map/tiles/{z}/{x}/{y}.png" url="/map/tiles/{z}/{x}/{y}.png"

View file

@ -33,7 +33,7 @@ class MyToolbar extends React.Component {
render() { render() {
return ( return (
<AppBar position="fixed"> <AppBar position="fixed">
<Toolbar> <Toolbar id="toolbar" >
<div style={{ width: "100%", display: "flex", justifyContent: "space-between", alignItems: "center" }}> <div style={{ width: "100%", display: "flex", justifyContent: "space-between", alignItems: "center" }}>
<Typography variant="h6" color="inherit"> <Typography variant="h6" color="inherit">
CCC Spaces CCC Spaces

View file

@ -1,3 +1,29 @@
body { body {
background-color: #333333; background-color: #333333;
}
#indexContainer {
display: flex;
flex-direction: column;
height: 100vh;
margin-top: 60px;
}
@media (min-width: 680px) {
#indexContainer {
flex-direction: row;
}
}
@media (orientation: landscape) {
#toolbar {
min-height: 20px !important;
.MuiIconButton-root {
padding: 3px !important;
}
}
#indexContainer {
margin-top: 32px;
}
} }

View file

@ -2,19 +2,15 @@ import React from 'react';
import Map from '../components/Map'; import Map from '../components/Map';
import EventList from '../components/EventList'; import EventList from '../components/EventList';
const style = {
container: {
display: 'flex',
flexDirection: 'column',
},
};
const IndexContainer = () => ( const IndexContainer = () => (
<div style={style.container}> <div id="indexContainer">
<div style={{ height: 'calc(50vh - 60px)', paddingTop: '60px'}}> <div style={{ flex: 2 }}>
<Map /> <Map />
</div> </div>
<EventList /> <div style={{ flex: 2 }}>
<EventList />
</div>
</div> </div>
); );