minor refactor

This commit is contained in:
ammarahm-ed
2020-11-14 10:07:05 +05:00
parent 724f8106b7
commit df9de4146e
2 changed files with 105 additions and 92 deletions

View File

@@ -10,6 +10,7 @@ export const NotebookItemWrapper = ({
index,
isTrash = false,
pinned = false,
isTopic,
}) => {
const [state, dispatch] = useTracked();
const {selectionMode, preventDefaultMargins} = state;
@@ -37,6 +38,14 @@ export const NotebookItemWrapper = ({
onLongPress();
return;
}
if (isTopic) {
NavigationService.navigate('NotesPage', {
...item,
});
return;
}
dispatch({
type: Actions.HEADER_TEXT_STATE,
state: {
@@ -45,7 +54,7 @@ export const NotebookItemWrapper = ({
});
dispatch({
type: Actions.HEADER_STATE,
state:false,
state: false,
});
NavigationService.navigate('Notebook', {
@@ -64,7 +73,7 @@ export const NotebookItemWrapper = ({
item={item}>
<NotebookItem
hideMore={preventDefaultMargins}
isTopic={item.type === 'topic'}
isTopic={isTopic}
customStyle={style}
item={item}
index={index}