feat: Added swipe gestures for dismissing panes on mobile (#2201)
This commit is contained in:
@@ -43,6 +43,8 @@ import { HistoryModalController } from '@/Controllers/NoteHistory/HistoryModalCo
|
||||
import { PaneController } from '@/Controllers/PaneController/PaneController'
|
||||
import EmptyFilesView from './EmptyFilesView'
|
||||
import { PaneLayout } from '@/Controllers/PaneController/PaneLayout'
|
||||
import { usePaneSwipeGesture } from '../Panes/usePaneGesture'
|
||||
import { mergeRefs } from '@/Hooks/mergeRefs'
|
||||
|
||||
type Props = {
|
||||
accountMenuController: AccountMenuController
|
||||
@@ -303,12 +305,14 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
|
||||
}
|
||||
}, [selectedUuids, innerRef, isCurrentNoteTemplate, renderedItems, panes])
|
||||
|
||||
const [setElement] = usePaneSwipeGesture('right', () => setPaneLayout(PaneLayout.TagSelection))
|
||||
|
||||
return (
|
||||
<div
|
||||
id={id}
|
||||
className={classNames(className, 'sn-component section h-full overflow-hidden pt-safe-top')}
|
||||
aria-label={'Notes & Files'}
|
||||
ref={innerRef}
|
||||
ref={mergeRefs([innerRef, setElement])}
|
||||
>
|
||||
{isMobileScreen && (
|
||||
<FloatingAddButton onClick={addNewItem} label={addButtonLabel} style={dailyMode ? 'danger' : 'info'} />
|
||||
|
||||
Reference in New Issue
Block a user