From 7d2c45da4313384029f5817b3814ade4242975c6 Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Fri, 3 Dec 2021 16:55:50 +0100 Subject: [PATCH] Improve mobile layout a bit (fixes #123) --- frontend/src/pages/HomePage.module.less | 4 ++- frontend/src/pages/SettingsPage.tsx | 2 +- frontend/src/pages/TrackEditor.tsx | 2 +- .../src/pages/TrackPage/TrackPage.module.less | 25 +++++++++++++------ frontend/src/styles.less | 3 +++ 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/frontend/src/pages/HomePage.module.less b/frontend/src/pages/HomePage.module.less index 7517a33..98585b7 100644 --- a/frontend/src/pages/HomePage.module.less +++ b/frontend/src/pages/HomePage.module.less @@ -1,9 +1,11 @@ +@import "styles.less"; + .welcomeMap { height: 60rem; max-height: 70vh; position: relative; - @media screen and (max-width: 767px) { + @media @mobile { margin: -35px -32px 0 -32px; max-height: 70vh; } diff --git a/frontend/src/pages/SettingsPage.tsx b/frontend/src/pages/SettingsPage.tsx index c91c3e6..7185ca8 100644 --- a/frontend/src/pages/SettingsPage.tsx +++ b/frontend/src/pages/SettingsPage.tsx @@ -45,7 +45,7 @@ const SettingsPage = connect((state) => ({login: state.login}), {setLogin})(func return ( - +
Your profile
diff --git a/frontend/src/pages/TrackEditor.tsx b/frontend/src/pages/TrackEditor.tsx index ae7b36b..9851019 100644 --- a/frontend/src/pages/TrackEditor.tsx +++ b/frontend/src/pages/TrackEditor.tsx @@ -95,7 +95,7 @@ const TrackEditor = connect((state) => ({login: state.login}))(function TrackEdi return ( - +
Edit {track ? track.title || 'Unnamed track' : 'track'}
diff --git a/frontend/src/pages/TrackPage/TrackPage.module.less b/frontend/src/pages/TrackPage/TrackPage.module.less index 927871a..8f785ca 100644 --- a/frontend/src/pages/TrackPage/TrackPage.module.less +++ b/frontend/src/pages/TrackPage/TrackPage.module.less @@ -1,13 +1,24 @@ +@import "styles.less"; + .stage { position: relative; margin-bottom: 32px; } -.details.details { - position: absolute; - width: 320px; - top: 16px; - right: 16px; - max-height: calc(100% - 32px); - overflow: auto; +@media @desktop { + .details.details { + position: absolute; + width: 320px; + top: 16px; + right: 16px; + max-height: calc(100% - 32px); + overflow: auto; + } +} + +@media @mobile { + .details > :global(.ui.segment) { + box-shadow: none; + border: none; + } } diff --git a/frontend/src/styles.less b/frontend/src/styles.less index 7c94b5f..b37df85 100644 --- a/frontend/src/styles.less +++ b/frontend/src/styles.less @@ -9,3 +9,6 @@ @secondaryColor: @obsColorG1; @menuHeight: 50px; + +@mobile: ~"screen and (max-width: 767px)"; +@desktop: ~"screen and (min-width: 768px)";