Skip to content

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

fix: focus mode on tablet pushes editor to one side

thecodrr8097865d9ebb
diff --git a/apps/web/src/app.js b/apps/web/src/app.js
index ad1e63560..1100eaf8b 100644
--- a/apps/web/src/app.js
+++ b/apps/web/src/app.js
@@ -92,7 +92,7 @@ function App() {
if (isFocusMode) {
setShow(false);
} else {
- setShow(true);
+ if (!isTablet) setShow(true);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isFocusMode]);
diff --git a/apps/web/src/components/editor/index.js b/apps/web/src/components/editor/index.js
index d54747324..c76860e13 100644
--- a/apps/web/src/components/editor/index.js
+++ b/apps/web/src/components/editor/index.js
@@ -109,7 +109,7 @@ function Editor(props) {
flexDirection="column"
sx={{
position: "relative",
- alignSelf: isFocusMode ? "center" : "stretch",
+ alignSelf: "stretch",
overflow: "hidden",
}}
flex="1 1 auto"
@@ -131,8 +131,8 @@ function Editor(props) {
alignSelf: ["stretch", "stretch", "center"],
}}
animate={{
- marginRight: isFocusMode ? "25%" : editorMargins,
- marginLeft: isFocusMode ? "25%" : editorMargins,
+ marginRight: isFocusMode && !isTablet ? "25%" : editorMargins,
+ marginLeft: isFocusMode && !isTablet ? "25%" : editorMargins,
}}
transition={{ duration: 0.3, ease: "easeOut" }}
maxWidth={isFocusMode ? "auto" : "900px"}
diff --git a/apps/web/src/components/editor/toolbar.js b/apps/web/src/components/editor/toolbar.js
index 3973450b1..4f86e7962 100644
--- a/apps/web/src/components/editor/toolbar.js
+++ b/apps/web/src/components/editor/toolbar.js
@@ -69,8 +69,9 @@ function Toolbar(props) {
},
{
title: isFocusMode ? "Normal mode" : "Focus mode",
- icon: Icon.FocusMode,
+ icon: isFocusMode ? Icon.NormalMode : Icon.FocusMode,
enabled: true,
+ hideOnMobile: true,
onClick: toggleFocusMode,
},
{
@@ -93,6 +94,7 @@ function Toolbar(props) {
size={18}
onClick={() => {
if (store.get().session.id) showToast("success", "Note saved!");
+ if (isFocusMode) toggleFocusMode();
clearSession();
}}
/>
@@ -115,6 +117,7 @@ function Toolbar(props) {
title={tool.title}
key={tool.title}
sx={{
+ display: [tool.hideOnMobile ? "none" : "block", "block", "block"],
color: tool.enabled ? "text" : "disabled",
cursor: tool.enabled ? "pointer" : "not-allowed",
}}
diff --git a/apps/web/src/components/navigation-menu/index.js b/apps/web/src/components/navigation-menu/index.js
index 3b4b5a0f9..9cb8f7471 100644
--- a/apps/web/src/components/navigation-menu/index.js
+++ b/apps/web/src/components/navigation-menu/index.js
@@ -84,8 +84,16 @@ function NavigationMenu(props) {
sx={{
borderRight: "1px solid",
borderRightColor: "border",
- minWidth: ["85%", isSideMenuOpen ? 150 : 0, isFocusMode ? 0 : 150],
- maxWidth: ["85%", isSideMenuOpen ? 150 : 0, isFocusMode ? 0 : 150],
+ minWidth: [
+ "85%",
+ isSideMenuOpen && !isFocusMode ? 150 : 0,
+ isFocusMode ? 0 : 150,
+ ],
+ maxWidth: [
+ "85%",
+ isSideMenuOpen && !isFocusMode ? 150 : 0,
+ isFocusMode ? 0 : 150,
+ ],
zIndex: !isSideMenuOpen ? -1 : isMobile ? 999 : isTablet ? 1 : 1,
height: ["100%", "auto", "auto"],
position: ["absolute", "relative", "relative"],