fix sidebar for mobile
This commit is contained in:
parent
e21b5be6f6
commit
b9f8fd73f1
2 changed files with 5 additions and 4 deletions
|
@ -68,7 +68,8 @@ function Page(props: Props) {
|
|||
if (isOnFilePage || isMediumScreen) {
|
||||
setSidebarOpen(false);
|
||||
}
|
||||
}, [isOnFilePage, isMediumScreen, setSidebarOpen]);
|
||||
// TODO: make sure setState callback for usePersistedState uses useCallback to it doesn't cause effect to re-run
|
||||
}, [isOnFilePage, isMediumScreen]);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
|
|
|
@ -324,7 +324,7 @@ function SideNavigation(props: Props) {
|
|||
// $FlowFixMe
|
||||
const { hideForUnauth, ...passedProps } = linkProps;
|
||||
return !email && linkProps.hideForUnauth && IS_WEB ? null : (
|
||||
<li key={linkProps.icon}>
|
||||
<li key={linkProps.link}>
|
||||
<Button
|
||||
{...passedProps}
|
||||
label={__(linkProps.title)}
|
||||
|
@ -390,7 +390,7 @@ function SideNavigation(props: Props) {
|
|||
// $FlowFixMe
|
||||
const { hideForUnauth, link, route, ...passedProps } = linkProps;
|
||||
return !email && linkProps.hideForUnauth && IS_WEB ? null : (
|
||||
<li key={linkProps.icon}>
|
||||
<li key={route || link}>
|
||||
<Button
|
||||
{...passedProps}
|
||||
navigate={route || link}
|
||||
|
@ -413,7 +413,7 @@ function SideNavigation(props: Props) {
|
|||
const { hideForUnauth, ...passedProps } = linkProps;
|
||||
|
||||
return !email && hideForUnauth && IS_WEB ? null : (
|
||||
<li key={linkProps.icon} className="mobile-only">
|
||||
<li key={linkProps.title} className="mobile-only">
|
||||
<Button
|
||||
{...passedProps}
|
||||
navigate={linkProps.link}
|
||||
|
|
Loading…
Add table
Reference in a new issue