From 22de1f7490f74b46c74a142bb0fe6f30ea890409 Mon Sep 17 00:00:00 2001 From: "Marcus R. Brown" Date: Thu, 12 Sep 2019 22:02:17 -0700 Subject: [PATCH] Fix sticker pack installation buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix sticker pack installation buttons - Add "↓ Free" text and update "Install" text - Distinguish between owned and free sticker sets - Rename owned -> owned? in price-badge - Add tiny-snt icon - Update the sticker price badge icon and padding Signed-off-by: Andrey Shovkoplyas --- .../src/main/res/drawable-mdpi/tiny_snt.png | Bin 0 -> 184 bytes .../src/main/res/drawable-xhdpi/tiny_snt.png | Bin 0 -> 270 bytes .../src/main/res/drawable-xxhdpi/tiny_snt.png | Bin 0 -> 362 bytes .../tiny-snt.imageset/Contents.json | 23 ++++++++++++++++++ .../tiny-snt.imageset/tiny-snt.png | Bin 0 -> 184 bytes .../tiny-snt.imageset/tiny-snt@2x.png | Bin 0 -> 270 bytes .../tiny-snt.imageset/tiny-snt@3x.png | Bin 0 -> 362 bytes src/status_im/ui/screens/stickers/styles.cljs | 2 +- src/status_im/ui/screens/stickers/views.cljs | 17 ++++++------- translations/en.json | 3 ++- 10 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 android/app/src/main/res/drawable-mdpi/tiny_snt.png create mode 100644 android/app/src/main/res/drawable-xhdpi/tiny_snt.png create mode 100644 android/app/src/main/res/drawable-xxhdpi/tiny_snt.png create mode 100644 ios/StatusIm/Images.xcassets/tiny-snt.imageset/Contents.json create mode 100644 ios/StatusIm/Images.xcassets/tiny-snt.imageset/tiny-snt.png create mode 100644 ios/StatusIm/Images.xcassets/tiny-snt.imageset/tiny-snt@2x.png create mode 100644 ios/StatusIm/Images.xcassets/tiny-snt.imageset/tiny-snt@3x.png diff --git a/android/app/src/main/res/drawable-mdpi/tiny_snt.png b/android/app/src/main/res/drawable-mdpi/tiny_snt.png new file mode 100644 index 0000000000000000000000000000000000000000..72489de78a2a628df004bb6e30e83d8908d437bb GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`^`0({Ar*{!FAIt|8}hh4v^u-e zued9C?!42pFULF!S#EjtrRCL?em7eWB>didu3eE9ju!#~T|tyDtJ++(QN26PI8r>mdKI;Vst0F0(jXaE2J literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xhdpi/tiny_snt.png b/android/app/src/main/res/drawable-xhdpi/tiny_snt.png new file mode 100644 index 0000000000000000000000000000000000000000..83bc68ce28fed569b30602fa70169811bd854283 GIT binary patch literal 270 zcmV+p0rCEcP)kdg0002hNklmBh)ujSaQKtN%Ri7A7`&9si^Vs3d>gv} zIfF^CfuU~$4|)QLgcGl`gMmJ3;NTHzJ*-5a&L~(!RU zVGnQa`~J?IK$pBFwEvkmfc8&Ip3gRJWD>c?=}&SG4e|wcoPFP31Ai!N?!!NsH@_-U U5G-nEfB*mh07*qoM6N<$f&z4HQ2+n{ literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable-xxhdpi/tiny_snt.png b/android/app/src/main/res/drawable-xxhdpi/tiny_snt.png new file mode 100644 index 0000000000000000000000000000000000000000..7b61eeb42e7d5ddb001ec5de835d187fc06fc006 GIT binary patch literal 362 zcmV-w0hRuVP)e#FUSrg54*_nLGjxBq+6-f36x zuK!&PjSp>PB2!l^OdNiX{7AV_UnBFepT6H9KjU+cWDV&q`3cEN-(G26f4GG!eWlXs z4U#}#8C3eCL|<7{d8&xwDbEQ)1p~cwgW1p^dFo%Oie*FtefA!3P#P3@yiuX=T`8QfT^;Z)(TTCu^t*0K6 z(dwU%d~>s!Tw05?KVX{87oDui-?~R6UDh^}7+yLW-}TJ;0)z4RlY8;|0000007*qo IM6N<$f=|GnGXMYp literal 0 HcmV?d00001 diff --git a/ios/StatusIm/Images.xcassets/tiny-snt.imageset/Contents.json b/ios/StatusIm/Images.xcassets/tiny-snt.imageset/Contents.json new file mode 100644 index 0000000000..7916cb823e --- /dev/null +++ b/ios/StatusIm/Images.xcassets/tiny-snt.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "tiny-snt.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "tiny-snt@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "tiny-snt@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/StatusIm/Images.xcassets/tiny-snt.imageset/tiny-snt.png b/ios/StatusIm/Images.xcassets/tiny-snt.imageset/tiny-snt.png new file mode 100644 index 0000000000000000000000000000000000000000..72489de78a2a628df004bb6e30e83d8908d437bb GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`^`0({Ar*{!FAIt|8}hh4v^u-e zued9C?!42pFULF!S#EjtrRCL?em7eWB>didu3eE9ju!#~T|tyDtJ++(QN26PI8r>mdKI;Vst0F0(jXaE2J literal 0 HcmV?d00001 diff --git a/ios/StatusIm/Images.xcassets/tiny-snt.imageset/tiny-snt@2x.png b/ios/StatusIm/Images.xcassets/tiny-snt.imageset/tiny-snt@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..83bc68ce28fed569b30602fa70169811bd854283 GIT binary patch literal 270 zcmV+p0rCEcP)kdg0002hNklmBh)ujSaQKtN%Ri7A7`&9si^Vs3d>gv} zIfF^CfuU~$4|)QLgcGl`gMmJ3;NTHzJ*-5a&L~(!RU zVGnQa`~J?IK$pBFwEvkmfc8&Ip3gRJWD>c?=}&SG4e|wcoPFP31Ai!N?!!NsH@_-U U5G-nEfB*mh07*qoM6N<$f&z4HQ2+n{ literal 0 HcmV?d00001 diff --git a/ios/StatusIm/Images.xcassets/tiny-snt.imageset/tiny-snt@3x.png b/ios/StatusIm/Images.xcassets/tiny-snt.imageset/tiny-snt@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..7b61eeb42e7d5ddb001ec5de835d187fc06fc006 GIT binary patch literal 362 zcmV-w0hRuVP)e#FUSrg54*_nLGjxBq+6-f36x zuK!&PjSp>PB2!l^OdNiX{7AV_UnBFepT6H9KjU+cWDV&q`3cEN-(G26f4GG!eWlXs z4U#}#8C3eCL|<7{d8&xwDbEQ)1p~cwgW1p^dFo%Oie*FtefA!3P#P3@yiuX=T`8QfT^;Z)(TTCu^t*0K6 z(dwU%d~>s!Tw05?KVX{87oDui-?~R6UDh^}7+yLW-}TJ;0)z4RlY8;|0000007*qo IM6N<$f=|GnGXMYp literal 0 HcmV?d00001 diff --git a/src/status_im/ui/screens/stickers/styles.cljs b/src/status_im/ui/screens/stickers/styles.cljs index b4eaf877c3..702b00a5e4 100644 --- a/src/status_im/ui/screens/stickers/styles.cljs +++ b/src/status_im/ui/screens/stickers/styles.cljs @@ -15,7 +15,7 @@ {:background-color (if not-enough-snt? colors/gray colors/blue) :border-radius 14 :flex-direction :row - :padding-horizontal 8 + :padding-horizontal 6 :height 28 :align-items :center}) diff --git a/src/status_im/ui/screens/stickers/views.cljs b/src/status_im/ui/screens/stickers/views.cljs index 03ec6495ec..45759ffd52 100644 --- a/src/status_im/ui/screens/stickers/views.cljs +++ b/src/status_im/ui/screens/stickers/views.cljs @@ -21,29 +21,28 @@ [react/view styles/installed-icon [icons/icon :main-icons/check {:color colors/white :height 20 :width 20}]]) -(defview price-badge [price id owned pending] +(defview price-badge [price id owned? pending] (letsubs [chain [:ethereum/chain-keyword] balance [:balance-default]] (let [snt (money/to-number (if (= :mainnet chain) (:SNT balance) (:STT balance))) not-enough-snt? (> price snt) no-snt? (or (nil? snt) (zero? snt))] [react/touchable-highlight {:on-press #(cond pending nil - (or owned (zero? price)) + (or owned? (zero? price)) (re-frame/dispatch [:stickers/install-pack id]) (or no-snt? not-enough-snt?) nil :else (re-frame/dispatch [:stickers/buy-pack id price]))} - [react/view (styles/price-badge (and (not (or owned (zero? price))) (or no-snt? not-enough-snt?))) - (when (and (not (zero? price))) ;(not no-snt?)) - [icons/icon :icons/price {:color colors/white :container-style {:margin-right 8}}]) + [react/view (styles/price-badge (and (not (or owned? (zero? price))) (or no-snt? not-enough-snt?))) + (when (and (not (zero? price)) (not owned?)) + [icons/tiny-icon :tiny-icons/tiny-snt {:color colors/white :container-style {:margin-right 6}}]) (if pending [react/activity-indicator {:animating true :color colors/white}] [react/text {:style {:color colors/white} :accessibility-label :sticker-pack-price} - (cond (or owned (zero? price)) - (i18n/label :t/install) - :else - (str (money/wei-> :eth price)))])]]))) + (cond owned? (i18n/label :t/install) + (zero? price) (i18n/label :t/free) + :else (str (money/wei-> :eth price)))])]]))) (defn pack-badge [{:keys [name author price thumbnail preview id installed owned pending] :as pack}] [react/touchable-highlight {:on-press #(re-frame/dispatch [:navigate-to :stickers-pack pack])} diff --git a/translations/en.json b/translations/en.json index 9881fe1edd..fabd170bd6 100644 --- a/translations/en.json +++ b/translations/en.json @@ -456,6 +456,7 @@ "finishing-card-setup-steps": "> Loading keys to the card\n> Generating multiaccount", "fleet": "Fleet", "fleet-settings": "Fleet settings", + "free": "↓ Free", "from": "From", "gas-limit": "Gas limit", "gas-price": "Gas price", @@ -510,7 +511,7 @@ ], "initialization": "Initialization", "initialization-of-the-card": "Initialization of the card", - "install": "Install", + "install": "↓ Install", "install-the-extension": "install the extension", "intro-message1": "Welcome to Status!\nTap this message to set your password and get started.", "intro-privacy-policy-note1": "Status does not collect, share or sell any personal data. By continuing you agree with the ",