diff --git a/apps/mobile/src/components/SimpleList/NotebookItemWrapper.js b/apps/mobile/src/components/SimpleList/NotebookItemWrapper.js new file mode 100644 index 000000000..e719afa27 --- /dev/null +++ b/apps/mobile/src/components/SimpleList/NotebookItemWrapper.js @@ -0,0 +1,55 @@ +import React from 'react'; +import { NotebookItem } from '../../components/NotebookItem'; +import SelectionWrapper from '../../components/SelectionWrapper'; +import { useTracked } from '../../provider'; +import { ACTIONS } from '../../provider/actions'; + +export const NotebookItemWrapper = ({item, index,isTrash = false, pinned = false}) => { + const [state, dispatch] = useTracked(); + const {selectionMode,preventDefaultMargins} = state; + let headerState = preventDefaultMargins? state.indHeaderState : state.headerState; + let params = headerState.route.params? headerState.route.params : {}; + + + return ( + + { + if (!selectionMode) { + dispatch({ + type: ACTIONS.SELECTION_MODE, + enabled: !selectionMode, + }); + } + + dispatch({ + type: ACTIONS.SELECTED_ITEMS, + item: item, + }); + }} + noteToMove={params.note} + item={item} + index={index} + isTrash={isTrash} + /> + + ); +};