mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
📱fix: set initial nav visibility for small screens (#3208)
* fix: hide nav on small screens by default * test: add spec for Nav component
This commit is contained in:
parent
81292bb4dd
commit
b8f2bee3fc
4 changed files with 136 additions and 0 deletions
|
|
@ -42,6 +42,10 @@ const Nav = ({ navVisible, setNavVisible }) => {
|
|||
|
||||
useEffect(() => {
|
||||
if (isSmallScreen) {
|
||||
const savedNavVisible = localStorage.getItem('navVisible');
|
||||
if (savedNavVisible === null) {
|
||||
toggleNavVisible();
|
||||
}
|
||||
setNavWidth('320px');
|
||||
} else {
|
||||
setNavWidth('260px');
|
||||
|
|
@ -102,6 +106,7 @@ const Nav = ({ navVisible, setNavVisible }) => {
|
|||
<TooltipProvider delayDuration={250}>
|
||||
<Tooltip>
|
||||
<div
|
||||
data-testid="nav"
|
||||
className={
|
||||
'nav active max-w-[320px] flex-shrink-0 overflow-x-hidden bg-gray-50 dark:bg-gray-850 md:max-w-[260px]'
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue