-
Notifications
You must be signed in to change notification settings - Fork 986
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
601045e
commit fc4c406
Showing
16 changed files
with
364 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(ns status-im.common.new-device-sheet.style | ||
(:require [quo.foundations.colors :as colors])) | ||
|
||
(def heading | ||
{:padding-left 20 | ||
:padding-bottom 8}) | ||
|
||
(def message | ||
{:padding-horizontal 20 | ||
:padding-top 4}) | ||
|
||
(def warning | ||
{:margin-horizontal 20 | ||
:margin-top 10}) | ||
|
||
(def drawer-container | ||
{:padding-horizontal 13 | ||
:padding-top 16}) | ||
|
||
(def settings-subtext | ||
{:color colors/white-opa-70 | ||
:align-self :center | ||
:margin-bottom 12}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
(ns status-im.common.new-device-sheet.view | ||
(:require | ||
[quo.core :as quo] | ||
[react-native.core :as rn] | ||
[status-im.common.events-helper :as events-helper] | ||
[status-im.common.new-device-sheet.style :as style] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn- pair-and-sync | ||
[installation-id] | ||
(rf/dispatch [:pairing/pair-and-sync installation-id]) | ||
(events-helper/hide-bottom-sheet)) | ||
|
||
(defn installation-request-receiver-view | ||
[installation-id] | ||
(rn/use-mount events-helper/dismiss-keyboard) | ||
[:<> | ||
[quo/text | ||
{:weight :semi-bold | ||
:size :heading-2 | ||
:accessibility-label :new-device-sheet-heading | ||
:style style/heading} | ||
(i18n/label :t/pair-new-device-and-sync)] | ||
[quo/text | ||
{:weight :regular | ||
:size :paragraph-1 | ||
:accessibility-label :new-device-sheet-message | ||
:style style/message} | ||
(i18n/label :t/new-device-detected-recovered-device-message)] | ||
[quo/text | ||
{:weight :semi-bold | ||
:size :heading-2 | ||
:accessibility-label :new-device-installation-id | ||
:style style/heading} | ||
installation-id] | ||
[quo/bottom-actions | ||
{:actions :two-actions | ||
:blur? true | ||
:container-style {:margin-top 12} | ||
:button-two-label (i18n/label :t/cancel) | ||
:button-two-props {:type :grey | ||
:on-press events-helper/hide-bottom-sheet} | ||
:button-one-label (i18n/label :t/pair-and-sync) | ||
:button-one-props {:on-press #(pair-and-sync installation-id)}}]]) | ||
|
||
(defn installation-request-creator-view | ||
[installation-id] | ||
(rn/use-mount events-helper/dismiss-keyboard) | ||
[:<> | ||
[quo/text | ||
{:weight :semi-bold | ||
:size :heading-2 | ||
:accessibility-label :new-device-sheet-heading | ||
:style style/heading} | ||
(i18n/label :t/pair-this-device-and-sync)] | ||
[quo/text | ||
{:weight :regular | ||
:size :paragraph-1 | ||
:accessibility-label :new-device-sheet-message | ||
:style style/message} | ||
(i18n/label :t/new-device-detected-other-device-message)] | ||
[quo/text | ||
{:weight :semi-bold | ||
:size :heading-2 | ||
:accessibility-label :new-device-installation-id | ||
:style style/heading} | ||
installation-id] | ||
[quo/bottom-actions | ||
{:actions :one-action | ||
:blur? true | ||
:container-style {:margin-top 12} | ||
:button-one-label (i18n/label :t/close) | ||
:button-one-props {:type :grey | ||
:on-press events-helper/hide-bottom-sheet}}]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
src/status_im/contexts/shell/activity_center/notification/syncing/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
(ns status-im.contexts.shell.activity-center.notification.syncing.view | ||
(:require | ||
[quo.core :as quo] | ||
quo.theme | ||
[react-native.core :as rn] | ||
[status-im.common.new-device-sheet.view :as new-device-sheet] | ||
[status-im.contexts.shell.activity-center.notification.common.view :as common] | ||
[utils.datetime :as datetime] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn- swipeable | ||
[{:keys [extra-fn]} child] | ||
[common/swipeable | ||
{:left-button common/swipe-button-read-or-unread | ||
:left-on-press common/swipe-on-press-toggle-read | ||
:right-button common/swipe-button-delete | ||
:right-on-press common/swipe-on-press-delete | ||
:extra-fn extra-fn} | ||
child]) | ||
|
||
(defn installation-created-view | ||
[{:keys [notification extra-fn]}] | ||
(let [{:keys [installationId read timestamp]} notification | ||
customization-color (rf/sub [:profile/customization-color]) | ||
theme (quo.theme/use-theme) | ||
more-details (rn/use-callback | ||
(fn [] | ||
(rf/dispatch [:show-bottom-sheet | ||
{:content | ||
(fn [] | ||
[new-device-sheet/installation-request-creator-view | ||
installationId])}])) | ||
[installationId])] | ||
[swipeable {:extra-fn extra-fn} | ||
[quo/activity-log | ||
{:title (i18n/label :t/sync-your-profile) | ||
:customization-color customization-color | ||
:icon :i/mobile | ||
:timestamp (datetime/timestamp->relative timestamp) | ||
:unread? (not read) | ||
:context [(i18n/label :t/check-other-device-for-pairing)] | ||
:items [{:type :button | ||
:subtype :positive | ||
:key :review-pairing-request | ||
:blur? true | ||
:label (i18n/label :t/more-details) | ||
:theme theme | ||
:on-press more-details}]}]])) | ||
|
||
(defn installation-received-view | ||
[{:keys [notification extra-fn]}] | ||
(let [{:keys [installationId read timestamp]} notification | ||
customization-color (rf/sub [:profile/customization-color]) | ||
theme (quo.theme/use-theme) | ||
review-pairing-request (rn/use-callback | ||
(fn [] | ||
(rf/dispatch [:show-bottom-sheet | ||
{:content | ||
(fn [] | ||
[new-device-sheet/installation-request-receiver-view | ||
installationId])}])) | ||
[installationId])] | ||
[swipeable {:extra-fn extra-fn} | ||
[quo/activity-log | ||
{:title (i18n/label :t/new-device-detected) | ||
:customization-color customization-color | ||
:icon :i/mobile | ||
:timestamp (datetime/timestamp->relative timestamp) | ||
:unread? (not read) | ||
:context [(i18n/label :t/new-device-detected)] | ||
:items [{:type :button | ||
:subtype :positive | ||
:key :review-pairing-request | ||
:blur? true | ||
:label (i18n/label :t/review-pairing-request) | ||
:theme theme | ||
:on-press review-pairing-request}]}]])) |
Oops, something went wrong.