Skip to content

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

feat: improve editor ui for smaller screens

thecodrr29e859603e2f
diff --git a/apps/web/src/components/editor/index.js b/apps/web/src/components/editor/index.js
index 5b72e7111..840fdbf5d 100644
--- a/apps/web/src/components/editor/index.js
+++ b/apps/web/src/components/editor/index.js
@@ -12,7 +12,6 @@ import Header from "./header";
import useMobile from "../../utils/use-mobile";
import useTablet from "../../utils/use-tablet";
import Toolbar from "./toolbar";
-import Banner from "../banner";
import EditorLoading from "./loading";
const ReactMCE = React.lazy(() => import("./tinymce"));
@@ -89,9 +88,7 @@ function Editor({ noteId, nonce }) {
alignSelf: "stretch",
overflow: "hidden",
}}
- flex="1 1 auto"
>
- {isMobile && <Banner />}
<Toolbar />
<Flex
variant="columnFill"
@@ -117,7 +114,6 @@ function Editor({ noteId, nonce }) {
variant="columnFill"
className="editor"
sx={{
- mx: [3, 3, 0],
alignSelf: ["stretch", "stretch", "center"],
}}
animate={{
@@ -125,19 +121,19 @@ function Editor({ noteId, nonce }) {
isFocusMode && !isTablet
? "25%"
: isTablet || isMobile
- ? "20px"
+ ? "10px"
: "35px",
paddingLeft:
isFocusMode && !isTablet
? "25%"
: isTablet || isMobile
- ? "20px"
+ ? "10px"
: "35px",
}}
transition={{ duration: 0.3, ease: "easeOut" }}
maxWidth={isFocusMode ? "auto" : "935px"}
width={["100%", "100%", isFocusMode ? "auto" : "100%"]}
- mt={[0, 0, 25]}
+ mt={[2, 2, 25]}
>
<Header />
diff --git a/apps/web/src/components/editor/toolbar.js b/apps/web/src/components/editor/toolbar.js
index 4047224ef..8f3a2644e 100644
--- a/apps/web/src/components/editor/toolbar.js
+++ b/apps/web/src/components/editor/toolbar.js
@@ -146,9 +146,10 @@ function Toolbar(props) {
<Flex justifyContent="center" alignItems="center" flex={1}>
<Icon.ArrowLeft
sx={{
- display: ["block", "block", "none"],
+ display: ["block", "none", "none"],
+ flexShrink: 0,
}}
- size={18}
+ size={24}
onClick={() => {
if (store.get().session.id) showToast("success", "Note saved!");
if (isFocusMode) toggleFocusMode();
@@ -157,8 +158,14 @@ function Toolbar(props) {
/>
<Animated.Input
ml={[2, 2, 0]}
- initial={{ opacity: isTitleVisible ? 1 : 0 }}
- animate={{ opacity: isTitleVisible ? 1 : 0 }}
+ initial={{
+ opacity: isTitleVisible ? 1 : 0,
+ zIndex: isTitleVisible ? 1 : -1,
+ }}
+ animate={{
+ opacity: isTitleVisible ? 1 : 0,
+ zIndex: isTitleVisible ? 1 : -1,
+ }}
transition={{ duration: 0.5 }}
fontWeight="heading"
fontSize="heading"
@@ -181,45 +188,46 @@ function Toolbar(props) {
}}
/>
</Flex>
- <Flex justifyContent="flex-end">
+ <Flex alignItems="center" justifyContent="flex-end">
{tools.map((tool) => (
<Button
data-test-id={tool.title.toLowerCase().replace(/ /g, "-")}
disabled={!tool.enabled}
variant="tool"
+ flexShrink={0}
ml={2}
title={tool.title}
key={tool.title}
sx={{
display: [
- tool.hideOnMobile ? "none" : "block",
- tool.hidden ? "none" : "block",
+ tool.hideOnMobile ? "none" : "flex",
+ tool.hidden ? "none" : "flex",
],
color: tool.enabled ? "text" : "disabled",
cursor: tool.enabled ? "pointer" : "not-allowed",
}}
onClick={tool.onClick}
+ flexDirection="row"
+ alignItems="center"
>
- <Flex justifyContent="center" alignItems="center">
- <tool.icon size={18} color={tool.enabled ? "text" : "disabled"} />
- <Text display={["none", "none", "block"]} fontSize="body" ml={1}>
- {tool.title}
+ <tool.icon size={18} color={tool.enabled ? "text" : "disabled"} />
+ <Text display={["none", "none", "block"]} variant="body" ml={1}>
+ {tool.title}
+ </Text>
+ {tool.new && (
+ <Text
+ variant="subBody"
+ fontSize={10}
+ ml={1}
+ bg="primary"
+ color="static"
+ px={"3px"}
+ py="1px"
+ sx={{ borderRadius: "default" }}
+ >
+ NEW
</Text>
- {tool.new && (
- <Text
- variant="subBody"
- fontSize={10}
- ml={1}
- bg="primary"
- color="static"
- px={"3px"}
- py="1px"
- sx={{ borderRadius: "default" }}
- >
- NEW
- </Text>
- )}
- </Flex>
+ )}
</Button>
))}
</Flex>