Skip to content

Commit

Permalink
[#20165] fix: apply reviewer's feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri committed May 31, 2024
1 parent 92ba1ee commit ef4b0f8
Showing 1 changed file with 20 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
(defn view
[props keypair]
(let [has-paired-device (rf/sub [:pairing/has-paired-devices])
missing-keypair? (rn/use-memo #(= (:stored props) :missing) [props])
missing-keypair? (= (:stored props) :missing)
on-scan-qr (rn/use-callback #(rf/dispatch [:open-modal :screen/settings.scan-keypair-qr
[(:key-uid keypair)]])
[keypair])
Expand All @@ -29,25 +29,23 @@
[quo/drawer-top props]
[quo/action-drawer
[(when has-paired-device
(concat
(if-not missing-keypair?
[{:icon :i/qr-code
:accessibility-label :show-key-pr-qr
:label (i18n/label :t/show-encrypted-qr-of-key-pairs)
:on-press on-show-qr}]
[{:icon :i/scan
:accessibility-label :import-by-scan-qr
:label (i18n/label :t/import-by-scanning-encrypted-qr)
:on-press on-scan-qr}])))
(if-not missing-keypair?
[{:icon :i/qr-code
:accessibility-label :show-key-pr-qr
:label (i18n/label :t/show-encrypted-qr-of-key-pairs)
:on-press on-show-qr}]
[{:icon :i/scan
:accessibility-label :import-by-scan-qr
:label (i18n/label :t/import-by-scanning-encrypted-qr)
:on-press on-scan-qr}]))
(when (= (:type props) :keypair)
(concat
[{:icon :i/edit
:accessibility-label :rename-key-pair
:label (i18n/label :t/rename-key-pair)
:on-press on-rename-keypair}]
[{:icon :i/delete
:accessibility-label :remove-key-pair
:add-divider? true
:danger? true
:label (i18n/label :t/remove-key-pair-and-derived-accounts)
:on-press on-remove-keypair}]))]]]))
[{:icon :i/edit
:accessibility-label :rename-key-pair
:label (i18n/label :t/rename-key-pair)
:on-press on-rename-keypair}
{:icon :i/delete
:accessibility-label :remove-key-pair
:add-divider? true
:danger? true
:label (i18n/label :t/remove-key-pair-and-derived-accounts)
:on-press on-remove-keypair}])]]]))

0 comments on commit ef4b0f8

Please sign in to comment.