diff --git a/README.md b/README.md index 6e688e348..ef92a3044 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ ## Overview -Notesnook is a free (as in speech) & open source note taking app focused on user privacy & ease of use. To ensure zero knowledge principles, Notesnook encrypts everything on your device using `XChaCha20-Poly1305` & `Argon2`. +Notesnook is a free (as in speech) & open-source note-taking app focused on user privacy & ease of use. To ensure zero knowledge principles, Notesnook encrypts everything on your device using `XChaCha20-Poly1305` & `Argon2`. -Notesnook is our **proof** that privacy does _not_ (always) have to come at the cost of convenience. Our goal is to provide users peace of mind & 100% confidence that their notes are safe and secure. The decision to go fully open source is one of the most crucial steps towards that. +Notesnook is our **proof** that privacy does _not_ (always) have to come at the cost of convenience. We aim to provide users peace of mind & 100% confidence that their notes are safe and secure. The decision to go fully open source is one of the most crucial steps towards that. -This repository contains all the code required to build & use the Notesnook web, desktop & mobile clients. If you are looking for a full features list or screenshots, please check the [website](https://notesnook.com/). +This repository contains all the code required to build & use the Notesnook web, desktop & mobile clients. If you are looking for a full feature list or screenshots, please check the [website](https://notesnook.com/). ## Developer guide diff --git a/apps/mobile/README.md b/apps/mobile/README.md index 8d2556674..a138a3034 100644 --- a/apps/mobile/README.md +++ b/apps/mobile/README.md @@ -19,9 +19,9 @@ ## Build instructions -> **Before you start it is recommended that you read [the contributing guidelines](/CONTRIBUTING.md).** +> **Before you start, it is recommended that you read [the contributing guidelines](/CONTRIBUTING.md).** -### Setting up development environment +### Setting up the development environment Requirements: @@ -57,7 +57,7 @@ npm install ### Running the app on Android -[Setup an Android emulator from Android Studio](https://developer.android.com/studio/run/managing-avds) if you haven't already and then run the following command to start the app in the Emulator: +[Setup an Android emulator from Android Studio](https://developer.android.com/studio/run/managing-avds) if you haven't already, and then run the following command to start the app in the Emulator: ```bash npm run start:android @@ -78,11 +78,11 @@ npm run start:ios ## Developer guide -> This project is in a transition state between Javascript & Typescript. We are gradually porting everything over to Typescript so if you can help with that, it'd be great! +> This project is in a transition state between Javascript & Typescript. We are gradually porting everything over to Typescript, so if you can help with that, it'd be great! ### The tech stack -We try to keep the stack as lean as possible +We try to keep the stack as lean as possible: 1. React Native 2. Typescript/Javascript @@ -95,17 +95,17 @@ We try to keep the stack as lean as possible The app codebase is distributed over two primary directories. `native/` and `app/`. -- `native/`: Includes `android/` and `ios/` folders and everything related to react native core functionality like bundling, development and packaging. Any react-native dependency that has native code i.e android & ios folders, is installed here. +- `native/`: Includes `android/` and `ios/` folders and everything related to react native core functionality like bundling, development, and packaging. Any react-native dependency with native code, i.e., android & ios folders, is installed here. -- `app/`: Includes all the app code other than the native part. All JS only dependencies are installed here. - - `components/`: Each component serves a specific purpose in the app UI, for example the `Paragraph` component is used to render paragraphs in the app and a `Header` component is used to render a `header` on all screens. - - `common/`: Features that have integral role in app functionality, for example, notesnook core is initialized here. +- `app/`: Includes all the app code other than the native part. All JS-only dependencies are installed here. + - `components/`: Each component serves a specific purpose in the app UI. For example, the `Paragraph` component is used to render paragraphs in the app, and a `Header` component is used to render a `header` on all screens. + - `common/`: Features that are integral to the app's functionality. For example, the notesnook core is initialized here. - `hooks/`: Hooks for different app logic - - `navigation/`: Includes app navigation specific code. Here the app navigation, editor & side menu are rendered side by side in fluid tabs. + - `navigation/`: Includes app navigation-specific code. Here the app navigation, editor & side menu are rendered side by side in fluid tabs. - `screens`: Navigator screens. - - `services`: Parts of code that do a specific function, for example, the `sync` service is responsibe for running Sync from anywhere in the app. - - `stores`: We use `zustand` for global state management in the app. There are multiple stores that provide the state for different parts of the app. - - `utils`: General purpose stuff such as constant values, utility functions etc. + - `services`: Parts of code that do a specific function. For example, the `sync` service runs Sync from anywhere in the app. + - `stores`: We use `zustand` for global state management in the app. Multiple stores provide the state for different parts of the app. + - `utils`: General purpose stuff such as constant values, utility functions, etc. There are several other folders at the root: @@ -115,11 +115,11 @@ There are several other folders at the root: ### Running the tests -When you are done making the required changes, you will need to run the tests to make sure you didn't break anything. We use Detox as the testing framework & the tests can be started as follows: +When you are done making the required changes, you must run the tests to ensure you didn't break anything. We use Detox as the testing framework & the tests can be started as follows: ### Android -To run the tests on android, you will need to create an emulator device on your system: +To run the tests on Android, you will need to create an emulator device on your system: ``` $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_5_API_31 -d pixel --package "system-images;android-31;default;x86_64" @@ -127,13 +127,13 @@ $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_5_API_31 -d pixel --packa If you face problems, follow the detailed guide in [Detox documentation](https://wix.github.io/Detox/docs/introduction/android-dev-env). Keep the emulator name set to `Pixel_5_API_31`. -Once you have created an emulator device, build the android apks +Once you have created an emulator device, build the Android apks: ``` npm run build:android ``` -Finally run the tests +Finally, run the tests: ``` npm run test:android @@ -141,9 +141,9 @@ npm run test:android ### iOS -To run e2e tests on iOS simulator, you must be on a Mac with XCode installed. +To run e2e tests on the iOS simulator, you must be on a Mac with XCode installed. -First install [AppleSimulatorUtils](https://github.com/wix/AppleSimulatorUtils) +First, install [AppleSimulatorUtils](https://github.com/wix/AppleSimulatorUtils): ``` brew tap wix/brew @@ -156,7 +156,7 @@ Now build the iOS app for testing: npm run build:ios ``` -Finally run the tests: +Finally, run the tests: ``` npm run test:ios diff --git a/apps/mobile/app/components/list/index.js b/apps/mobile/app/components/list/index.js index 495f8b323..28c3fc7bf 100644 --- a/apps/mobile/app/components/list/index.js +++ b/apps/mobile/app/components/list/index.js @@ -218,12 +218,14 @@ const List = ({ } /> - + {listData ? ( + + ) : null} ); }; diff --git a/apps/mobile/app/components/sheets/add-notebook/index.js b/apps/mobile/app/components/sheets/add-notebook/index.js index 596b360aa..898ae5e75 100644 --- a/apps/mobile/app/components/sheets/add-notebook/index.js +++ b/apps/mobile/app/components/sheets/add-notebook/index.js @@ -25,22 +25,22 @@ import { TouchableOpacity, View } from "react-native"; +import { FlatList } from "react-native-actions-sheet"; import { notesnook } from "../../../../e2e/test.ids"; import { db } from "../../../common/database"; import { DDS } from "../../../services/device-detection"; -import { presentSheet, ToastEvent } from "../../../services/event-manager"; +import { ToastEvent, presentSheet } from "../../../services/event-manager"; import Navigation from "../../../services/navigation"; import { useMenuStore } from "../../../stores/use-menu-store"; import { useRelationStore } from "../../../stores/use-relation-store"; -import { ph, pv, SIZE } from "../../../utils/size"; +import { SIZE, ph, pv } from "../../../utils/size"; import { sleep } from "../../../utils/time"; -import DialogHeader from "../../dialog/dialog-header"; import { Button } from "../../ui/button"; import { IconButton } from "../../ui/icon-button"; import Input from "../../ui/input"; import Seperator from "../../ui/seperator"; +import Heading from "../../ui/typography/heading"; import { MoveNotes } from "../move-notes/movenote"; -import { FlatList } from "react-native-actions-sheet"; let refs = []; export class AddNotebookSheet extends React.Component { @@ -245,13 +245,34 @@ export class AddNotebookSheet extends React.Component { willFocus && this.topicInputRef.current?.focus(); }; + renderTopicItem = ({ item, index }) => ( + { + this.prevIndex = index; + this.prevItem = item; + this.topicInputRef.current?.setNativeProps({ + text: item + }); + this.topicInputRef.current?.focus(); + this.currentInputValue = item; + this.setState({ + editTopic: true + }); + }} + onDelete={this.onDelete} + index={index} + colors={this.props.colors} + /> + ); + render() { const { colors } = this.props; const { topics, topicInputFocused, notebook } = this.state; return ( - - + + + + {notebook && notebook.dateCreated + ? "Edit Notebook" + : "New Notebook"} + +