Fix broken spec validator for screen params

Signed-off-by: Goran Jovic <goranjovic@gmail.com>
This commit is contained in:
Foo Pang 2018-02-10 16:28:09 +08:00 committed by Goran Jovic
parent d12c9b0495
commit ce34bb4349
No known key found for this signature in database
GPG Key ID: A778DE3CD7D2D10D
3 changed files with 23 additions and 19 deletions

View File

@ -2,5 +2,5 @@
(:require [status-im.ui.screens.navigation :as navigation]))
(defmethod navigation/preload-data! :dapp-description
[db [_ _ dapp]]
(assoc db :new/open-dapp dapp))
[db [_ _ {:keys [dapp]}]]
(assoc db :new/open-dapp dapp))

View File

@ -14,7 +14,7 @@
(defn render-row [row _ _]
[contact-view/contact-view {:contact row
:on-press #(re-frame/dispatch [:navigate-to :dapp-description row])
:on-press #(re-frame/dispatch [:navigate-to :dapp-description {:dapp row}])
:show-forward? true}])
(views/defview open-dapp []

View File

@ -87,27 +87,31 @@
;; navigation screen params
(spec/def :navigation.screen-params/network-details (allowed-keys :req [:networks/selected-network]))
(spec/def :navigation.screen-params/browser (allowed-keys :req [:browser/browser-id]))
(spec/def :navigation.screen-params/contact (spec/nilable map?))
(spec/def :navigation.screen-params/qr-source (spec/nilable keyword?))
(spec/def :navigation.screen-params/qr-value (spec/nilable string?))
(spec/def :navigation.screen-params/qr-viewer (allowed-keys :opt-un [:navigation.screen-params/contact
:navigation.screen-params/qr-source
:navigation.screen-params/qr-value]))
(spec/def :navigation.screen-params/current-qr-context (spec/nilable any?))
(spec/def :navigation.screen-params/qr-scanner (allowed-keys :opt-un [:navigation.screen-params/current-qr-context]))
(spec/def :navigation.screen-params/show-search? (spec/nilable any?))
(spec/def :navigation.screen-params.profile-qr-viewer/contact (spec/nilable map?))
(spec/def :navigation.screen-params.profile-qr-viewer/source (spec/nilable keyword?))
(spec/def :navigation.screen-params.profile-qr-viewer/value (spec/nilable string?))
(spec/def :navigation.screen-params/profile-qr-viewer (allowed-keys :opt-un [:navigation.screen-params.profile-qr-viewer/contact
:navigation.screen-params.profile-qr-viewer/source
:navigation.screen-params.profile-qr-viewer/value]))
(spec/def :navigation.screen-params.qr-scanner/current-qr-context (spec/nilable any?))
(spec/def :navigation.screen-params/qr-scanner (allowed-keys :opt-un [:navigation.screen-params.qr-scanner/current-qr-context]))
(spec/def :navigation.screen-params.group-contacts/show-search? (spec/nilable any?))
(spec/def :navigation.screen-params/group-contacts (allowed-keys :opt [:group/contact-group-id]
:opt-un [:navigation.screen-params/show-search?]))
(spec/def :navigation.screen-params/group (spec/nilable any?))
(spec/def :navigation.screen-params/group-type (spec/nilable any?))
(spec/def :navigation.screen-params/edit-contact-group (allowed-keys :opt-un [:navigation.screen-params/group
:navigation.screen-params/group-type]))
:opt-un [:navigation.screen-params.group-contacts/show-search?]))
(spec/def :navigation.screen-params.edit-contact-group/group (spec/nilable any?))
(spec/def :navigation.screen-params.edit-contact-group/group-type (spec/nilable any?))
(spec/def :navigation.screen-params/edit-contact-group (allowed-keys :opt-un [:navigation.screen-params.edit-contact-group/group
:navigation.screen-params.edit-contact-group/group-type]))
(spec/def :navigation.screen-params.dapp-description/dapp :new/open-dapp)
(spec/def :navigation.screen-params/dapp-description (allowed-keys :opt-un [:navigation.screen-params.dapp-description/dapp]))
(spec/def :navigation/screen-params (spec/nilable (allowed-keys :opt-un [:navigation.screen-params/network-details
:navigation.screen-params/browser
:navigation.screen-params/qr-viewer
:navigation.screen-params/profile-qr-viewer
:navigation.screen-params/qr-scanner
:navigation.screen-params/group-contacts
:navigation.screen-params/edit-contact-group])))
:navigation.screen-params/edit-contact-group
:navigation.screen-params/dapp-description])))
;;;;NETWORK