From 5ac90dc100c131adb6672c862c5ec53578cd342a Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Wed, 9 Sep 2020 11:10:35 +0500 Subject: [PATCH] fix all buttons --- apps/mobile/.gitignore | 4 + apps/mobile/.vscode/launch.json | 1 + apps/mobile/android/app/_BUCK | 55 -- apps/mobile/android/app/build_defs.bzl | 19 - apps/mobile/ios/Podfile.lock | 6 + .../src/components/AddTopicDialog/index.js | 50 +- apps/mobile/src/components/Button/index.js | 68 +- .../src/components/ExportDialog/index.js | 21 +- apps/mobile/src/components/Loading/index.js | 22 +- .../src/components/MergeEditor/index.js | 642 ++++++++---------- .../src/components/NotebookItem/index.js | 46 +- .../src/components/Premium/PremiumDialog.js | 38 +- apps/mobile/src/components/Seperator/index.js | 15 + .../src/components/VaultDialog/index.js | 149 ++-- 14 files changed, 441 insertions(+), 695 deletions(-) delete mode 100644 apps/mobile/android/app/_BUCK delete mode 100644 apps/mobile/android/app/build_defs.bzl create mode 100644 apps/mobile/src/components/Seperator/index.js diff --git a/apps/mobile/.gitignore b/apps/mobile/.gitignore index ad572e632..ab3f579e9 100644 --- a/apps/mobile/.gitignore +++ b/apps/mobile/.gitignore @@ -57,3 +57,7 @@ buck-out/ # CocoaPods /ios/Pods/ + + +# Other +react-native-mmkv-storage/ diff --git a/apps/mobile/.vscode/launch.json b/apps/mobile/.vscode/launch.json index 70e3c4d0f..a39dad9e5 100644 --- a/apps/mobile/.vscode/launch.json +++ b/apps/mobile/.vscode/launch.json @@ -4,6 +4,7 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { "name": "Debug Android", "cwd": "${workspaceFolder}", diff --git a/apps/mobile/android/app/_BUCK b/apps/mobile/android/app/_BUCK deleted file mode 100644 index 7c2fef741..000000000 --- a/apps/mobile/android/app/_BUCK +++ /dev/null @@ -1,55 +0,0 @@ -# To learn about Buck see [Docs](https://buckbuild.com/). -# To run your application with Buck: -# - install Buck -# - `npm start` - to start the packager -# - `cd android` -# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` -# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck -# - `buck install -r android/app` - compile, install and run application -# - -load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") - -lib_deps = [] - -create_aar_targets(glob(["libs/*.aar"])) - -create_jar_targets(glob(["libs/*.jar"])) - -android_library( - name = "all-libs", - exported_deps = lib_deps, -) - -android_library( - name = "app-code", - srcs = glob([ - "src/main/java/**/*.java", - ]), - deps = [ - ":all-libs", - ":build_config", - ":res", - ], -) - -android_build_config( - name = "build_config", - package = "com.streetwriters.notesnook", -) - -android_resource( - name = "res", - package = "com.streetwriters.notesnook", - res = "src/main/res", -) - -android_binary( - name = "app", - keystore = "//android/keystores:debug", - manifest = "src/main/AndroidManifest.xml", - package_type = "debug", - deps = [ - ":app-code", - ], -) diff --git a/apps/mobile/android/app/build_defs.bzl b/apps/mobile/android/app/build_defs.bzl deleted file mode 100644 index fff270f8d..000000000 --- a/apps/mobile/android/app/build_defs.bzl +++ /dev/null @@ -1,19 +0,0 @@ -"""Helper definitions to glob .aar and .jar targets""" - -def create_aar_targets(aarfiles): - for aarfile in aarfiles: - name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] - lib_deps.append(":" + name) - android_prebuilt_aar( - name = name, - aar = aarfile, - ) - -def create_jar_targets(jarfiles): - for jarfile in jarfiles: - name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] - lib_deps.append(":" + name) - prebuilt_jar( - name = name, - binary_jar = jarfile, - ) diff --git a/apps/mobile/ios/Podfile.lock b/apps/mobile/ios/Podfile.lock index 36c9ba83f..70545b6d8 100644 --- a/apps/mobile/ios/Podfile.lock +++ b/apps/mobile/ios/Podfile.lock @@ -321,6 +321,8 @@ PODS: - React-Core - RNCMaskedView (0.1.10): - React + - RNDeviceInfo (6.0.2): + - React - RNGestureHandler (1.7.0): - React - RNReanimated (1.13.0): @@ -397,6 +399,7 @@ DEPENDENCIES: - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - rn-fetch-blob (from `../node_modules/rn-fetch-blob`) - "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)" + - RNDeviceInfo (from `../node_modules/react-native-device-info`) - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - RNReanimated (from `../node_modules/react-native-reanimated`) - RNScreens (from `../node_modules/react-native-screens`) @@ -495,6 +498,8 @@ EXTERNAL SOURCES: :path: "../node_modules/rn-fetch-blob" RNCMaskedView: :path: "../node_modules/@react-native-community/masked-view" + RNDeviceInfo: + :path: "../node_modules/react-native-device-info" RNGestureHandler: :path: "../node_modules/react-native-gesture-handler" RNReanimated: @@ -562,6 +567,7 @@ SPEC CHECKSUMS: ReactCommon: a0a1edbebcac5e91338371b72ffc66aa822792ce rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba RNCMaskedView: 5a8ec07677aa885546a0d98da336457e2bea557f + RNDeviceInfo: bdd61e8b070d13a1dd9d022091981075ed4cde16 RNGestureHandler: b6b359bb800ae399a9c8b27032bdbf7c18f08a08 RNReanimated: 89f5e0a04d1dd52fbf27e7e7030d8f80a646a3fc RNScreens: b748efec66e095134c7166ca333b628cd7e6f3e2 diff --git a/apps/mobile/src/components/AddTopicDialog/index.js b/apps/mobile/src/components/AddTopicDialog/index.js index 22faeeac1..3ad9a388f 100644 --- a/apps/mobile/src/components/AddTopicDialog/index.js +++ b/apps/mobile/src/components/AddTopicDialog/index.js @@ -7,6 +7,7 @@ import {getElevation, ToastEvent, db} from '../../utils/utils'; import {eSendEvent} from '../../services/eventManager'; import {eOnNewTopicAdded} from '../../services/events'; import {Toast} from '../Toast'; +import {Button} from '../Button'; export class AddTopicDialog extends React.Component { constructor(props) { @@ -134,7 +135,7 @@ export class AddTopicDialog extends React.Component { }); }} defaultValue={toEdit ? toEdit.title : null} - onChangeText={value => { + onChangeText={(value) => { this.title = value; }} placeholder="Enter title of topic" @@ -148,51 +149,16 @@ export class AddTopicDialog extends React.Component { flexDirection: 'row', marginTop: 20, }}> - await this.addNewTopic()} - style={{ - paddingVertical: pv, - paddingHorizontal: ph, - borderRadius: 5, - width: '45%', - justifyContent: 'center', - alignItems: 'center', - borderColor: colors.accent, - backgroundColor: colors.accent, - borderWidth: 1, - }}> - - {toEdit ? 'Save' : 'Add'} - - - - +