-
Notifications
You must be signed in to change notification settings - Fork 987
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add share tab for profile inside Shell
- Loading branch information
1 parent
6417d90
commit d0f81a5
Showing
9 changed files
with
358 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(ns quo2.components.qr-code.qr | ||
(:require [react-native.core :as rn])) | ||
|
||
(defn user-profile-qr-code | ||
[{:keys [key-uid public-key port qr-size]}] | ||
(let [profile-qr-url (str "https://join.status.im/u/" public-key) | ||
base-64-qr-url (js/btoa profile-qr-url) | ||
profile-image-type "large" | ||
error-correction-level 4 | ||
superimpose-profile? true | ||
media-server-url (str "https://localhost:" | ||
port | ||
"/GenerateQRCode?level=" | ||
error-correction-level | ||
"&url=" | ||
base-64-qr-url | ||
"&keyUid=" | ||
key-uid | ||
"&allowProfileImage=" | ||
superimpose-profile? | ||
"&size=" | ||
qr-size | ||
"&imageName=" | ||
profile-image-type)] | ||
[rn/view | ||
{:style {:flex-direction :row | ||
:justify-content :center}} | ||
[rn/image | ||
{:source {:uri media-server-url} | ||
:style {:width qr-size | ||
:height qr-size | ||
:border-radius 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
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,24 @@ | ||
(ns status-im2.contexts.share.events | ||
(:require [utils.re-frame :as rf] | ||
[status-im2.common.toasts.events :as toasts] | ||
[quo2.foundations.colors :as colors])) | ||
|
||
(rf/defn open-profile-share-view | ||
{:events [:share/open]} | ||
[{:keys [db]}] | ||
{:dispatch [:show-popover | ||
{:view :profile-share | ||
:style {:margin 0} | ||
:disable-touchable-overlay? true | ||
:blur-view? true | ||
:blur-view-props {:blur-amount 20 | ||
:blur-type :dark}}]}) | ||
|
||
(rf/defn show-successfully-copied-toast | ||
{:events [:share/show-successfully-copied-toast]} | ||
[cofx toast-label] | ||
(toasts/upsert cofx | ||
{:icon :correct | ||
:icon-color colors/success-50 | ||
:override-theme :dark | ||
:text toast-label})) |
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,122 @@ | ||
(ns status-im2.contexts.share.style | ||
(:require [quo2.foundations.colors :as colors])) | ||
|
||
(def screen-padding 20) | ||
(def qr-container-radius 16) | ||
(def emoji-hash-container-radius 16) | ||
|
||
(def header-button | ||
{:margin-bottom 12 | ||
:margin-left screen-padding}) | ||
|
||
(def header-heading | ||
{:padding-horizontal screen-padding | ||
:padding-vertical 12 | ||
:color colors/white}) | ||
|
||
(defn screen-container | ||
[window-width top bottom] | ||
{:flex 1 | ||
:width window-width | ||
:padding-top (if (pos? top) (+ top 12) 12) | ||
:padding-bottom bottom}) | ||
|
||
(def tabs | ||
{:padding-left screen-padding}) | ||
|
||
(defn qr-code-container | ||
[window-width] | ||
{:padding 12 | ||
:border-radius qr-container-radius | ||
:margin-top 12 | ||
:margin-bottom 4 | ||
:margin-horizontal (* window-width 0.053) | ||
:background-color colors/white-opa-5 | ||
:flex-direction :column | ||
:justify-content :center | ||
:align-items :center}) | ||
|
||
|
||
(defn emoji-hash-container | ||
[window-width] | ||
{:border-radius emoji-hash-container-radius | ||
:margin-top 12 | ||
:padding-vertical :1% | ||
:margin-horizontal (* window-width 0.053) | ||
:background-color colors/white-opa-5 | ||
:flex-direction :row | ||
:justify-content :space-between | ||
:align-items :center}) | ||
|
||
(def profile-address-column | ||
{:flex-direction :column}) | ||
|
||
(def profile-address-label | ||
{:align-self :flex-start | ||
:color colors/white-opa-40 | ||
:padding-top 10}) | ||
|
||
(def copyable-text-container-style | ||
{:background-color :transparent}) | ||
|
||
(defn profile-address-content | ||
[max-width] | ||
{:color colors/white | ||
:align-self :flex-start | ||
:padding-top 2 | ||
:font-weight :500 | ||
:font-size 16 | ||
:max-width max-width}) | ||
|
||
(def address-share-button-container | ||
{:padding 8 | ||
:position :absolute | ||
:background-color colors/white-opa-5 | ||
:border-radius 10 | ||
:right 14 | ||
:top 10}) | ||
|
||
(defn profile-address-container | ||
[qr-size] | ||
{:flex-direction :row | ||
:justify-content :space-between | ||
:margin-top 6 | ||
:width qr-size}) | ||
|
||
(def emoji-hash-label | ||
{:color colors/white-opa-40 | ||
:padding-left 12 | ||
:margin-top 8}) | ||
|
||
(def share-button-container | ||
{:flex-direction :column | ||
:justify-content :center | ||
:align-items :center | ||
:padding-left 12}) | ||
|
||
(defn set-custom-width | ||
[section-width] | ||
{:width section-width}) | ||
|
||
(defn emoji-hash-content | ||
[max-width] | ||
{:color colors/white | ||
:align-self :flex-start | ||
:padding-top 4 | ||
:padding-bottom 8 | ||
:padding-left 12 | ||
:font-weight :500 | ||
:font-size 14 | ||
:max-width max-width}) | ||
|
||
(def emoji-share-button-container | ||
{:padding 8 | ||
:position :absolute | ||
:background-color colors/white-opa-5 | ||
:border-radius 10 | ||
:right 14 | ||
:top 2}) | ||
|
||
(def tabs-container | ||
{:padding-horizontal screen-padding | ||
:margin-vertical 8}) |
Oops, something went wrong.