Skip to content

Commit

Permalink
staging progress for the day
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Mar 30, 2023
1 parent f386ad6 commit a3773c9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 38 deletions.
20 changes: 9 additions & 11 deletions src/status_im2/contexts/share/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
{:padding-left screen-padding})

(defn qr-code-container [window-width & wallet-tab]
{:padding-vertical 20
{:padding 12
:border-radius qr-container-radius
:margin-top (if wallet-tab 8 20)
:margin-top 12
:margin-bottom 4
:margin-horizontal (* window-width 0.053)
:width :89.3%
Expand All @@ -37,13 +37,13 @@
:align-items :center})

(def profile-address-column
{:align-self :flex-start})
{:align-self :flex-start
:flex-direction :column})


(def profile-address-label
{:align-self :flex-start
:color colors/white-opa-40
:padding-horizontal 20
:padding-top 10})

(def copyable-text-container-style
Expand All @@ -53,7 +53,6 @@
(defn profile-address-content [max-width]
{:color colors/white
:align-self :flex-start
:padding-horizontal 20
:padding-top 2
:font-weight :500
:font-size 16
Expand All @@ -79,8 +78,7 @@

(def profile-address-container
{:flex-direction :row
:margin-top 6
:width :98%})
:margin-top 6})

(def emoji-hash-label
{:color colors/white-opa-40
Expand All @@ -93,12 +91,11 @@
(defn emoji-hash-content [max-width]
{:color colors/white
:align-self :flex-start
:padding-horizontal 20
:padding-left 20
:padding-top 4
:padding-bottom 8
:font-weight :500
:font-size 10
:max-width max-width})
:font-size 10})

(def emoji-share-button-container
{:padding 8
Expand All @@ -109,4 +106,5 @@
:top 2})

(def tabs-container
{:padding screen-padding})
{:padding-horizontal screen-padding
:margin-vertical 8})
63 changes: 36 additions & 27 deletions src/status_im2/contexts/share/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,39 @@
(defn profile-tab [window-width]
(let [multiaccount (rf/sub [:multiaccount])
emoji-hash (string/join " " (get multiaccount :emoji-hash))
keyuid (get multiaccount :key-uid)
key-uid (get multiaccount :key-uid)
current-pk (get multiaccount :public-key)
port (rf/sub [:mediaserver/port])
qr-size (- window-width 64)
profile-qr-url (str "https://join.status.im/u/" current-pk)
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=2&url="
(js/btoa profile-qr-url)
"/GenerateQRCode?level="
error-correction-level
"&url="
base-64-qr-url
"&keyUid="
keyuid
"&allowProfileImage=true"
"&size=200"
"&imageName=large")]
key-uid
"&allowProfileImage="
superimpose-profile?
"&size="
qr-size
"&imageName="
profile-image-type)
]
(log/info "emoji-hash ->" (string/join " " (get multiaccount :emoji-hash)))
[:<>
[rn/view {:style (style/qr-code-container window-width)}
[rn/view {:style {:flex-direction :row
:justify-content :center}}
[rn/image {:source {:uri media-server-url}
:style {:width 303
:height 303
:margin-top 30
:border-radius 4
:margin-right 4}}
]
]
:style {:width qr-size
:height qr-size
:border-radius 12}}]]
[rn/view {:style style/profile-address-container}
[rn/view {:style style/profile-address-column}
[quo/text
Expand All @@ -79,14 +86,16 @@
:number-of-lines 1}
profile-qr-url]]]

[rn/view
[rn/view {:style {:flex-direction :column
:justify-content :center
:align-items :center
}}
[quo/button
{:icon true
:type :blur-bg
:size 32
:accessibility-label :link-to-profile
:override-theme :dark
:style style/header-button
;;:on-press ;;;; TODO(siddarthay) : figure this out and take appropriate action
}
:i/share]]]]
Expand All @@ -99,18 +108,18 @@
:style style/emoji-hash-label}
(i18n/label :t/emoji-hash)]
[copyable-text/copyable-text-view {:copied-text emoji-hash :container-style style/copyable-text-container-style}
[rn/view {:style {:flex-direction :row}}
[rn/text {:style (style/emoji-hash-content (* window-width 0.7))} emoji-hash]
[rn/view
[quo/button
{:icon true
:type :blur-bg
:size 32
:accessibility-label :link-to-profile
:override-theme :dark
:style style/header-button
;;:on-press ;;;; TODO(siddarthay) : probably do nothing here? idk
}
:i/share]]]]]]
[quo/button
{:icon true
:type :blur-bg
:size 32
:accessibility-label :link-to-profile
:override-theme :dark
:style style/header-button
}
:i/share]]
]]]]
]))

(defn wallet-tab [window-width]
Expand Down

0 comments on commit a3773c9

Please sign in to comment.