diff --git a/public/manifest.json b/public/manifest.json index a8d5e764..14db030e 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -30,6 +30,6 @@ "scope": "/", "start_url": "/", "display": "standalone", - "theme_color": "ffffff", + "theme_color": "#ffffff", "background_color": "#ffffff" } \ No newline at end of file diff --git a/src/App.css b/src/App.css index 76c915de..e53c2a77 100644 --- a/src/App.css +++ b/src/App.css @@ -1,18 +1,23 @@ :root { --navbar-height: 70px; --navbar-height: calc(56px + max(env(safe-area-inset-bottom), 14px)); + --theme-color: #2c2f33; } html, body, -#root, -.App { +#root { height: 100%; } - +#root { + overflow: auto; +} +.App { + min-height: 100%; +} html, body { - background-color: #2c2f33; + background-color: var(--theme-color); margin: 0; padding: 0; font-size: 14px; @@ -38,44 +43,8 @@ body { .App { text-align: left; background-color: #2c2f33; - display: flex; - flex-direction: column; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -.MainContent { - overflow: auto; - flex: 1; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -.Container { - padding: 1.5rem 3rem 0; - flex-grow: 1; + display: grid; + grid-template-rows: 1fr auto; } .footer { diff --git a/src/App.tsx b/src/App.tsx index 97ac5bcc..dba6f690 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,7 +11,17 @@ import './App.css'; function App() { // Load locations const [locations, setLocations] = useState([]); - + const [scrollFromTop, setScrolledFromTop] = useState(0); + const scrollListener = (event: Event) => { + setScrolledFromTop((event.target as HTMLElement).scrollTop); + }; + useEffect(() => { + const rootDiv = document.getElementById('root'); + if (!rootDiv) + throw Error('Missing root div! (Why did you rename it lol)'); + rootDiv.addEventListener('scroll', scrollListener); + return () => rootDiv.removeEventListener('scroll', scrollListener); + }); useEffect(() => { queryLocations().then((parsedLocations: $TSFixMe) => { if (parsedLocations != null) { @@ -42,7 +52,12 @@ function App() { } + element={ + + } /> - + getGreeting(), []); // Search query processing @@ -117,7 +117,6 @@ function ListPage({ locations }: $TSFixMe) { window.removeEventListener('offline', handleOnlineStatus); }; }, []); - return (
{/* showAlert && @@ -136,9 +135,14 @@ function ListPage({ locations }: $TSFixMe) { offline. We apologize for any inconvenience. 🌐🚫 )} -
-
- {greeting} +
+
+ + {greeting} + setSearchQuery('')} /> )} - + {openLocations .sort( (location1: Location, location2: Location) =>