Skip to content

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

feat: show a very simple editor on mobile

thecodrr66820b824237
diff --git a/apps/web/src/components/banner/index.js b/apps/web/src/components/banner/index.js
new file mode 100644
index 000000000..84779c48e
--- /dev/null
+++ b/apps/web/src/components/banner/index.js
@@ -0,0 +1,14 @@
+import React from "react";
+import { Flex, Text } from "rebass";
+
+function Banner() {
+ return (
+ <Flex alignItems="center" justifyContent="center" bg="primary" py={1}>
+ <Text color="static" textAlign="center" fontSize="title">
+ Use our <a href="https://notesnook.com/mobile">mobile app</a> for a
+ better experience.
+ </Text>
+ </Flex>
+ );
+}
+export default Banner;
diff --git a/apps/web/src/components/editor/index.js b/apps/web/src/components/editor/index.js
index 50bfc9b8f..a99d5b796 100644
--- a/apps/web/src/components/editor/index.js
+++ b/apps/web/src/components/editor/index.js
@@ -22,6 +22,7 @@ import { SUBSCRIPTION_STATUS } from "../../common";
import Toolbar from "./toolbar";
import Footer from "./footer";
import ObservableArray from "../../utils/observablearray";
+import Banner from "../banner";
function Editor() {
const sessionState = useStore((store) => store.session.state);
@@ -104,7 +105,6 @@ function Editor() {
return (
<Flex
flexDirection="column"
- width={"100%"}
sx={{
position: "relative",
alignSelf: isFocusMode ? "center" : "stretch",
@@ -112,6 +112,7 @@ function Editor() {
}}
flex="1 1 auto"
>
+ {isMobile && <Banner />}
<Toolbar quill={quillRef.current?.quill} />
<Flex
variant="columnFill"
diff --git a/apps/web/src/components/editor/react-quill.js b/apps/web/src/components/editor/react-quill.js
index 310a566aa..5b8af33b7 100644
--- a/apps/web/src/components/editor/react-quill.js
+++ b/apps/web/src/components/editor/react-quill.js
@@ -7,29 +7,32 @@ import MarkdownShortcuts from "./modules/markdown";
import MagicUrl from "quill-magic-url";
import { Text } from "rebass";
import QuillFocus from "./modules/focus";
+import { isMobile } from "../../utils/dimensions";
Quill.register("modules/markdownShortcuts", MarkdownShortcuts);
Quill.register("modules/magicUrl", MagicUrl);
Quill.register("modules/focus", QuillFocus);
-const quillModules = (_isSimple, isFocusMode) => ({
- toolbar: [
- ["bold", "italic", "underline", "strike", "blockquote"],
- [{ header: "2" }, { header: "3" }, { header: [false, 4, 5, 6] }],
- [
- { align: "" },
- { align: "center" },
- { align: "right" },
- { align: "justify" },
- ],
- [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
- [{ indent: "-1" }, { indent: "+1" }],
- [{ size: ["small", false, "large", "huge"] }],
- ["code-block", { script: "sub" }, { script: "super" }],
- [{ color: [] }, { background: [] }],
- ["link", "image", "video"],
- [{ direction: "rtl" }, "clean"],
- ],
+const quillModules = (isSimple, isFocusMode, isMobile) => ({
+ toolbar: isMobile
+ ? ["bold", "italic", "underline"]
+ : [
+ ["bold", "italic", "underline", "strike", "blockquote"],
+ [{ header: "2" }, { header: "3" }, { header: [false, 4, 5, 6] }],
+ [
+ { align: "" },
+ { align: "center" },
+ { align: "right" },
+ { align: "justify" },
+ ],
+ [{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
+ [{ indent: "-1" }, { indent: "+1" }],
+ [{ size: ["small", false, "large", "huge"] }],
+ ["code-block", { script: "sub" }, { script: "super" }],
+ [{ color: [] }, { background: [] }],
+ ["link", "image", "video"],
+ [{ direction: "rtl" }, "clean"],
+ ],
// syntax: true,
markdownShortcuts: {},
magicUrl: true,
@@ -89,7 +92,7 @@ export default class ReactQuill extends Component {
placeholder,
bounds: container,
scrollingContainer: scrollContainer,
- modules: modules || quillModules(isSimple, isFocusMode),
+ modules: modules || quillModules(isSimple, isFocusMode, isMobile()),
theme: "snow",
readOnly,
});