Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

add fullscreen to global state

ammarahm-edd5646e02f7b5
diff --git a/apps/mobile/src/provider/Actions.js b/apps/mobile/src/provider/Actions.js
index 2e80337fc..150f10767 100644
--- a/apps/mobile/src/provider/Actions.js
+++ b/apps/mobile/src/provider/Actions.js
@@ -28,5 +28,6 @@ export const Actions = {
HEADER_VERTICAL_MENU:'verticalMenu',
HEADER_TEXT_STATE:'headerTextState',
MESSAGE_BOARD_STATE:'messageBoardState',
- LOADING:"loading"
+ LOADING:"loading",
+ FULLSCREEN:"fullscreen"
};
diff --git a/apps/mobile/src/provider/DefaultState.js b/apps/mobile/src/provider/DefaultState.js
index 91466b24e..1ca8da91c 100644
--- a/apps/mobile/src/provider/DefaultState.js
+++ b/apps/mobile/src/provider/DefaultState.js
@@ -16,6 +16,7 @@ export const defaultState = {
tags: [],
colorNotes: [],
user: null,
+ fullscreen:false,
premiumUser: true,
settings: {
showToolbarOnTop: false,
@@ -68,9 +69,7 @@ export const defaultState = {
placeholder: 'Search all notes',
},
containerBottomButton: {
- visible: true,
- bottomButtonOnPress: () => {},
- bottomButtonText: 'Create a new note',
+ onPress: () => {},
},
messageBoardState: {
visible: false,
diff --git a/apps/mobile/src/provider/Reducer.js b/apps/mobile/src/provider/Reducer.js
index 6a491b36c..ac6ac1ef5 100644
--- a/apps/mobile/src/provider/Reducer.js
+++ b/apps/mobile/src/provider/Reducer.js
@@ -4,6 +4,7 @@ import storage from '../utils/storage';
import {history, SORT, sortSettings} from '../utils/index';
import {Actions} from './Actions';
import {db} from '../utils/DB';
+import {defaultState} from './DefaultState';
export const reducer = (state, action) => {
switch (action.type) {
@@ -226,13 +227,13 @@ export const reducer = (state, action) => {
};
}
case Actions.CONTAINER_BOTTOM_BUTTON: {
- let containerBottomButton = {
- ...state.containerBottomButton,
+ let _state = {
+ ...defaultState.containerBottomButton,
...action.state,
};
return {
...state,
- containerBottomButton: containerBottomButton,
+ containerBottomButton: _state,
};
}
case Actions.MESSAGE_BOARD_STATE: {
@@ -241,6 +242,12 @@ export const reducer = (state, action) => {
messageBoardState: action.state,
};
}
+ case Actions.FULLSCREEN: {
+ return {
+ ...state,
+ fullscreen: action.state,
+ };
+ }
default:
throw new Error('unknown action type');
}