Skip to content

Commit

Permalink
Mobile UI on desktop can be enabled in .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
vkjr committed Apr 18, 2019
1 parent 78a1b02 commit e327ae4
Show file tree
Hide file tree
Showing 33 changed files with 413 additions and 152 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ HOST_OS := $(shell uname | tr '[:upper:]' '[:lower:]')
export NIX_CONF_DIR = $(PWD)/nix

export REACT_SERVER_PORT ?= 5001 # any value different from default 5000 will work; this has to be specified for both the Node.JS server process and the Qt process
export STATUS_NODE_PORT ?= 12345 # no need to specify this if just running dev instance alongside release build
export STATUS_DATA_DIR ?= ~/status-files/data1 # this is where Realm data files, Geth node data, and logs will reside; also not strictly needed for dev alongside release
#export STATUS_NODE_PORT ?= 12345 # no need to specify this if just running dev instance alongside release build
#export STATUS_DATA_DIR ?= ~/status-files/data1 # this is where Realm data files, Geth node data, and logs will reside; also not strictly needed for dev alongside release

# WARNING: This has to be located right before the targets
ifdef IN_NIX_SHELL
Expand Down
1 change: 1 addition & 0 deletions clj-rn.conf.edn
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"text-encoding"
"js-sha3"
"web3-utils"
"react-navigation"
"hi-base32"]

;; Resoures
Expand Down
3 changes: 2 additions & 1 deletion desktop_files/package.json.orig
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"querystring-es3": "0.2.1",
"react": "16.6.1",
"react-dom": "16.4.2",
"react-native": "git+https://github.com/status-im/react-native-desktop.git#v0.57.8_1",
"react-native": "git+https://github.com/status-im/react-native-desktop.git#fix/for_mobile_2",
"react-native-background-timer": "2.0.0",
"react-native-camera": "0.10.0",
"react-native-config": "git+https://github.com/status-im/react-native-config.git#v0.11.2-status",
Expand All @@ -91,6 +91,7 @@
"react-native-tcp": "3.3.0",
"react-native-udp": "2.2.1",
"react-native-webview-bridge": "git+https://github.com/status-im/react-native-webview-bridge.git#0.33.16-status-rn049-desktop",
"react-navigation": "^2.12.1",
"realm": "git+https://github.com/status-im/realm-js.git#heads/v2.20.1",
"rn-snoopy": "git+https://github.com/status-im/rn-snoopy.git#v2.0.2-status",
"status-conan": "git+https://github.com/status-im/status-conan.git#v1.0.0",
Expand Down
154 changes: 150 additions & 4 deletions desktop_files/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2273,6 +2273,11 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
inherits "^2.0.1"
safe-buffer "^5.0.1"

clamp@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/clamp/-/clamp-1.0.1.tgz#66a0e64011816e37196828fdc8c8c147312c8634"
integrity sha1-ZqDmQBGBbjcZaCj9yMjBRzEshjQ=

class-extend@^0.1.0, class-extend@^0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/class-extend/-/class-extend-0.1.2.tgz#8057a82b00f53f82a5d62c50ef8cffdec6fabc34"
Expand Down Expand Up @@ -2655,6 +2660,14 @@ create-react-class@^15.6.0, create-react-class@^15.6.3:
loose-envify "^1.3.1"
object-assign "^4.1.1"

create-react-context@0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.2.tgz#9836542f9aaa22868cd7d4a6f82667df38019dca"
integrity sha512-KkpaLARMhsTsgp0d2NA/R94F/eDLbhXERdIq3LvX2biCAXcDvHYoOqHfWCHf1+OLj+HKBotLG3KqaOOf+C1C+A==
dependencies:
fbjs "^0.8.0"
gud "^1.0.0"

cross-spawn-async@^2.1.1, cross-spawn-async@^2.2.2:
version "2.2.5"
resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc"
Expand Down Expand Up @@ -3604,7 +3617,7 @@ fbjs-scripts@^1.0.0:
semver "^5.1.0"
through2 "^2.0.0"

fbjs@^0.8.16, fbjs@^0.8.9:
fbjs@^0.8.0, fbjs@^0.8.16, fbjs@^0.8.9:
version "0.8.17"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=
Expand Down Expand Up @@ -4202,6 +4215,11 @@ gruntfile-editor@^1.0.0:
ast-query "^2.0.0"
lodash "^4.6.1"

gud@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0"
integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==

gulp-decompress@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/gulp-decompress/-/gulp-decompress-1.2.0.tgz#8eeb65a5e015f8ed8532cafe28454960626f0dc7"
Expand Down Expand Up @@ -4369,6 +4387,11 @@ hmac-drbg@^1.0.0:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.1"

hoist-non-react-statics@^2.2.0, hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0:
version "2.5.5"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==

home-or-tmp@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb"
Expand Down Expand Up @@ -6620,6 +6643,13 @@ path-to-regexp@0.1.7:
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=

path-to-regexp@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
integrity sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=
dependencies:
isarray "0.0.1"

path-type@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
Expand Down Expand Up @@ -6817,7 +6847,7 @@ prop-types@15.6.0:
loose-envify "^1.3.1"
object-assign "^4.1.1"

prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2:
prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2:
version "15.6.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==
Expand Down Expand Up @@ -6894,6 +6924,14 @@ query-string@^5.0.1:
object-assign "^4.1.0"
strict-uri-encode "^1.0.0"

query-string@^6.1.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.2.0.tgz#468edeb542b7e0538f9f9b1aeb26f034f19c86e1"
integrity sha512-5wupExkIt8RYL4h/FE+WTg3JHk62e6fFPWtAZA9J5IWK1PfTfKkMS93HBUHcFpeYi9KsY5pFbh+ldvEyaz5MyA==
dependencies:
decode-uri-component "^0.2.0"
strict-uri-encode "^2.0.0"

querystring-es3@0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73"
Expand Down Expand Up @@ -6991,6 +7029,16 @@ react-dom@16.4.2:
object-assign "^4.1.1"
prop-types "^15.6.0"

react-is@^16.5.2:
version "16.8.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.1.tgz#a80141e246eb894824fb4f2901c0c50ef31d4cdb"
integrity sha512-ioMCzVDWvCvKD8eeT+iukyWrBGrA3DiFYkXfBsVYIRdaREZuBjENG+KjrikavCLasozqRWTwFUagU/O4vPpRMA==

react-lifecycles-compat@^3, react-lifecycles-compat@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==

react-native-background-timer@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/react-native-background-timer/-/react-native-background-timer-2.0.0.tgz#afdac10b7441952d570acea4a8dbb065107b5461"
Expand Down Expand Up @@ -7027,6 +7075,25 @@ react-native-dialogs@0.0.20:
resolved "https://registry.yarnpkg.com/react-native-dialogs/-/react-native-dialogs-0.0.20.tgz#f3fb48eadba9d83fb9d4e6d7eca573494a8cefaa"
integrity sha512-HeoU9d7wWUUAtxjcIJLaeIs/eYS2ZHTNh3kboeCKngLvfvgptd/7vZXwXdQ+xeOEek+cm95kDfMJQd2xnb+4wA==

react-native-dismiss-keyboard@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/react-native-dismiss-keyboard/-/react-native-dismiss-keyboard-1.0.0.tgz#32886242b3f2317e121f3aeb9b0a585e2b879b49"
integrity sha1-MohiQrPyMX4SHzrrmwpYXiuHm0k=

react-native-drawer-layout-polyfill@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/react-native-drawer-layout-polyfill/-/react-native-drawer-layout-polyfill-1.3.2.tgz#192c84d7a5a6b8a6d2be2c7daa5e4164518d0cc7"
integrity sha512-XzPhfLDJrYHru+e8+dFwhf0FtTeAp7JXPpFYezYV6P1nTeA1Tia/kDpFT+O2DWTrBKBEI8FGhZnThrroZmHIxg==
dependencies:
react-native-drawer-layout "1.3.2"

react-native-drawer-layout@1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/react-native-drawer-layout/-/react-native-drawer-layout-1.3.2.tgz#b9740d7663a1dc4f88a61b9c6d93d2d948ea426e"
integrity sha512-fjO0scqbJUfNu2wuEpvywL7DYLXuCXJ2W/zYhWz986rdLytidbys1QGVvkaszHrb4Y7OqO96mTkgpOcP8KWevw==
dependencies:
react-native-dismiss-keyboard "1.0.0"

react-native-fetch-polyfill@1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/react-native-fetch-polyfill/-/react-native-fetch-polyfill-1.1.2.tgz#256b5a0abd78cc4992f7a7cf82543da2f2124a73"
Expand Down Expand Up @@ -7093,6 +7160,18 @@ react-native-qrcode@0.2.6:
prop-types "^15.5.10"
qr.js "0.0.0"

react-native-safe-area-view@0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.11.0.tgz#4f3dda43c2bace37965e7c6aef5fc83d4f19d174"
integrity sha512-N3nElaahu1Me2ltnfc9acpgt1znm6pi8DSadKy79kvdzKwvVIzw0IXueA/Hjr51eCW1BsfNw7D1SgBT9U6qEkA==
dependencies:
hoist-non-react-statics "^2.3.1"

react-native-screens@^1.0.0-alpha.11:
version "1.0.0-alpha.22"
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.22.tgz#7a120377b52aa9bbb94d0b8541a014026be9289b"
integrity sha512-kSyAt0AeVU6N7ZonfV6dP6iZF8B7Bce+tk3eujXhzBGsLg0VSLnU7uE9VqJF0xdQrHR91ZjGgVMieo/8df9KTA==

react-native-scrollable-mixin@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/react-native-scrollable-mixin/-/react-native-scrollable-mixin-1.0.1.tgz#34a32167b64248594154fd0d6a8b03f22740548e"
Expand All @@ -7118,6 +7197,20 @@ react-native-svg@6.3.1:
lodash "^4.16.6"
pegjs "^0.10.0"

react-native-tab-view@^0.0.77:
version "0.0.77"
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.77.tgz#11ceb8e7c23100d07e628dc151b57797524d00d4"
integrity sha512-9vjD4Ly1Zlum1Y4g23ODpi/F3gYIUIsKWrsZO/Oh5cuX1eiB1DRVn11nY1z+j/hsQfhfyW6nDlmySyDvYQvYCA==
dependencies:
prop-types "^15.6.0"

react-native-tab-view@^1.0.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-1.3.2.tgz#c4e43a538dcacce151938745cea09176beeccbc3"
integrity sha512-2U+HxDQdjzExoC6gZ+wUhC8v8JjntppsFVU4v4pRvC/1dkN7DJv1k8UEy9+p7ucEaNrcAzu/j5N09Jf4qG36vw==
dependencies:
prop-types "^15.6.1"

react-native-tcp@3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/react-native-tcp/-/react-native-tcp-3.3.0.tgz#8eea75b7b2c2c6db4b91f38f171fba3b2a1b60ee"
Expand Down Expand Up @@ -7148,9 +7241,9 @@ react-native-udp@2.2.1:
invariant "2.2.0"
keymirror "0.1.1"

"react-native@git+https://github.com/status-im/react-native-desktop.git#v0.57.8_1":
"react-native@git+https://github.com/status-im/react-native-desktop.git#fix/for_mobile_2":
version "0.57.8"
resolved "git+https://github.com/status-im/react-native-desktop.git#174fb14b354dbecef31be27d934390da7806ce50"
resolved "git+https://github.com/status-im/react-native-desktop.git#9ad69561bb89589d4840a024614937dea6d014b9"
dependencies:
"@babel/runtime" "^7.0.0"
absolute-path "^0.0.0"
Expand Down Expand Up @@ -7207,6 +7300,54 @@ react-native-udp@2.2.1:
yeoman-environment "^1.2.7"
yeoman-generator "^0.20.3"

react-navigation-deprecated-tab-navigator@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/react-navigation-deprecated-tab-navigator/-/react-navigation-deprecated-tab-navigator-1.3.0.tgz#015dcae1e977b984ca7e99245261c15439026bb7"
integrity sha512-Cm+qYOPFWbvvcuv0YYX0ioYwLGgw7XAqdhAfpo3sIr3trxRW8871ePmfFOPezjQtz4v6ItjZt6LPgtBAVZoroQ==
dependencies:
react-native-tab-view "^0.0.77"

react-navigation-drawer@0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/react-navigation-drawer/-/react-navigation-drawer-0.5.0.tgz#d91b6a6ec65c34ba78c00f814b1e6508922cc9ec"
integrity sha512-F1y593uC6pqBMGH+Omz75oNODEbxB/s0EGO8QtYwu1NmOOEUuuLA+c14zm+pgMsI4HlDabiHxPkWqsgGz25xVQ==
dependencies:
react-native-drawer-layout-polyfill "^1.3.2"

react-navigation-stack@0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-0.7.0.tgz#0b2f139ee1cba953037ef51353df992ec6c74fa2"
integrity sha512-3Tbb/SsustBrM9R/qaI6XuOfyqYMVbwkeHFC8NbU890vB0aKZvjAtioWLZ18e/4LgbiOCmoTdp37z3gkGDyNDQ==

react-navigation-tabs@0.8.4:
version "0.8.4"
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.8.4.tgz#aa767f28b899f13c99f2b034b4a665f8cf0a5737"
integrity sha512-CbS3xIVJVtpu+AYslv0PMLmjddJFVtU3XAhSJ9XnMrKLUJNmnQdW/L0w/Gp5qcBEF9h6bgsY3CoTtp7I6bqyOQ==
dependencies:
hoist-non-react-statics "^2.5.0"
prop-types "^15.6.1"
react-lifecycles-compat "^3.0.4"
react-native-tab-view "^1.0.0"

react-navigation@^2.12.1:
version "2.18.3"
resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-2.18.3.tgz#de9a24dc37dfc33f3e4779a9f13f45ea97dfe19e"
integrity sha512-/5KGMG1Oj5LN/x/7AKF0MWrpX9Qe29307RxEsMCiRT/A4jCYT0DPY99Bl7ZAGtROxExEy3rwTfTrtvpIT+CU7A==
dependencies:
clamp "^1.0.1"
create-react-context "0.2.2"
hoist-non-react-statics "^2.2.0"
path-to-regexp "^1.7.0"
query-string "^6.1.0"
react-is "^16.5.2"
react-lifecycles-compat "^3"
react-native-safe-area-view "0.11.0"
react-native-screens "^1.0.0-alpha.11"
react-navigation-deprecated-tab-navigator "1.3.0"
react-navigation-drawer "0.5.0"
react-navigation-stack "0.7.0"
react-navigation-tabs "0.8.4"

react-proxy@^1.1.7:
version "1.1.8"
resolved "https://registry.yarnpkg.com/react-proxy/-/react-proxy-1.1.8.tgz#9dbfd9d927528c3aa9f444e4558c37830ab8c26a"
Expand Down Expand Up @@ -8110,6 +8251,11 @@ strict-uri-encode@^1.0.0:
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=

strict-uri-encode@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546"
integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY=

string-width@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
(def snoopy-bars #js {})
(def snoopy-buffer #js {})
(def background-timer #js {:setTimeout (fn [cb ms] (js/setTimeout cb ms))})
(def react-navigation #js {:NavigationActions #js {}})
(def react-navigation (js/require "react-navigation"))
43 changes: 32 additions & 11 deletions src/status_im/desktop/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,41 @@
status-im.ui.screens.events
status-im.ui.screens.subs
status-im.data-store.core
[reagent.impl.component :as reagent.component]
[status-im.ui.components.desktop.shortcuts :as shortcuts]
[status-im.ui.screens.desktop.views :as views]
[status-im.ui.screens.views :as views]
[status-im.ui.components.react :as react]
[status-im.notifications.core :as notifications]
[status-im.core :as core]
[status-im.desktop.deep-links :as deep-links]))
[status-im.utils.snoopy :as snoopy]
[status-im.ui.components.desktop.shortcuts :as shortcuts]
[status-im.ui.screens.desktop.views :as desktop-views]
[status-im.desktop.deep-links :as deep-links]
[status-im.utils.config :as config]))

(defn app-state-change-handler [state]
(re-frame/dispatch [:app-state-change state]))

(defn app-root [props]
(reagent/create-class
{:component-did-mount (fn [this]
(re-frame/dispatch [:set-initial-props (reagent/props this)])
(shortcuts/register-default-shortcuts)
(deep-links/add-event-listener))
:reagent-render (fn [props]
views/main)}))
(if config/mobile-ui-for-desktop?
(reagent/create-class
{:component-will-mount
(fn []
(.addEventListener react/app-state "change" app-state-change-handler))
:component-did-mount
(fn [this]
(re-frame/dispatch [:set-initial-props (reagent/props this)]))
:component-will-unmount
(fn []
(.stop react/http-bridge)
(.removeEventListener react/app-state "change" app-state-change-handler))
:display-name "root"
:reagent-render views/main})
(reagent/create-class
{:component-did-mount (fn [this]
(re-frame/dispatch [:set-initial-props (reagent/props this)])
(shortcuts/register-default-shortcuts)
(deep-links/add-event-listener))
:reagent-render (fn [props]
desktop-views/main)})))

(defn init []
(core/init app-root))
Loading

0 comments on commit e327ae4

Please sign in to comment.