From 2f246a90d0a97e4cb0bc73664c060495c1ef9527 Mon Sep 17 00:00:00 2001 From: ajaythapliyal Date: Sat, 25 Feb 2023 11:51:17 +0530 Subject: [PATCH] on mobile view the app used to launch with nav bar open, this fixes it. About page had same large horizontal margin which made about page very narrow. This fixes it. --- frontend/src/About.tsx | 2 +- frontend/src/App.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/About.tsx b/frontend/src/About.tsx index 0f2b5db6..814943d7 100644 --- a/frontend/src/About.tsx +++ b/frontend/src/About.tsx @@ -4,7 +4,7 @@ export default function About() { return ( //Parent div for all content shown through App.tsx routing needs to have this styling. Might change when state management is updated. -
+

About DocsGPT 🦖

diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index b0c6cb2d..2cbe582d 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -6,7 +6,10 @@ import { useState } from 'react'; import { ActiveState } from './models/misc'; export default function App() { - const [navState, setNavState] = useState('ACTIVE'); + //TODO : below media query is disjoint from tailwind. Please wire it together. + const [navState, setNavState] = useState( + window.matchMedia('((min-width: 768px)').matches ? 'ACTIVE' : 'INACTIVE', + ); return (