fix: default to notes list on launch on mobile (#1599)

This commit is contained in:
Aman Harwara
2022-09-20 15:28:45 +05:30
committed by GitHub
parent 66a25c7556
commit 571919c969

View File

@@ -1,4 +1,5 @@
import { ElementIds } from '@/Constants/ElementIDs' import { ElementIds } from '@/Constants/ElementIDs'
import { isMobileScreen } from '@/Utils'
import { useEffect, ReactNode, useMemo, createContext, useCallback, useContext, useState } from 'react' import { useEffect, ReactNode, useMemo, createContext, useCallback, useContext, useState } from 'react'
import { AppPaneId } from './AppPaneMetadata' import { AppPaneId } from './AppPaneMetadata'
@@ -24,8 +25,12 @@ type Props = {
} }
const ResponsivePaneProvider = ({ children }: Props) => { const ResponsivePaneProvider = ({ children }: Props) => {
const [currentSelectedPane, setCurrentSelectedPane] = useState<AppPaneId>(AppPaneId.Editor) const [currentSelectedPane, setCurrentSelectedPane] = useState<AppPaneId>(
const [previousSelectedPane, setPreviousSelectedPane] = useState<AppPaneId>(AppPaneId.Editor) isMobileScreen() ? AppPaneId.Items : AppPaneId.Editor,
)
const [previousSelectedPane, setPreviousSelectedPane] = useState<AppPaneId>(
isMobileScreen() ? AppPaneId.Items : AppPaneId.Editor,
)
const toggleAppPane = useCallback( const toggleAppPane = useCallback(
(paneId: AppPaneId) => { (paneId: AppPaneId) => {