diff --git a/src/main/assets/stylesheets/components/lbutton.less b/src/main/assets/stylesheets/components/lbutton.less index 37371ff..86489ef 100644 --- a/src/main/assets/stylesheets/components/lbutton.less +++ b/src/main/assets/stylesheets/components/lbutton.less @@ -52,15 +52,18 @@ lbutton { } &.medium { + display: inline-flex; + flex-direction: row; + height: 20px; + justify-content: center; + align-items: center; border-radius: 10px; - letter-spacing: -0.3px; - padding-top: 4px; - padding-bottom: 5px; - padding-left: 8px; - padding-right: 8px; + padding-left: 10px; + padding-right: 10px; span { font-size: @font-size-very-small; + font-weight: @font-weight-regular; } } diff --git a/src/main/assets/stylesheets/controllers/onboarding/select.less b/src/main/assets/stylesheets/controllers/onboarding/select.less index 740837e..a7082c9 100644 --- a/src/main/assets/stylesheets/controllers/onboarding/select.less +++ b/src/main/assets/stylesheets/controllers/onboarding/select.less @@ -14,7 +14,7 @@ justify-content: center; align-items: center; flex-direction: column; - border-radius: 12px; + border-radius: 16px; cursor: pointer; margin-left: 10px; @@ -25,10 +25,12 @@ > h1 { color: @color-white; font-size: @font-size-extra-extra-large; + font-weight: @font-weight-light; } > p { color: @color-white; + margin-top: 3px; font-size: @font-size-medium; } diff --git a/src/main/resources/images/common/ic_error_big_red.png b/src/main/resources/images/common/ic_error_big_red.png index cfce563..f85c83e 100644 Binary files a/src/main/resources/images/common/ic_error_big_red.png and b/src/main/resources/images/common/ic_error_big_red.png differ diff --git a/src/main/resources/images/common/ic_error_big_red@2x.png b/src/main/resources/images/common/ic_error_big_red@2x.png index 4a779ad..3820065 100644 Binary files a/src/main/resources/images/common/ic_error_big_red@2x.png and b/src/main/resources/images/common/ic_error_big_red@2x.png differ diff --git a/src/main/resources/images/common/ic_usb.png b/src/main/resources/images/common/ic_usb.png index 02aa2a5..3d9cac5 100644 Binary files a/src/main/resources/images/common/ic_usb.png and b/src/main/resources/images/common/ic_usb.png differ diff --git a/src/main/resources/images/common/ic_usb@2x.png b/src/main/resources/images/common/ic_usb@2x.png index efda597..c7b5abd 100644 Binary files a/src/main/resources/images/common/ic_usb@2x.png and b/src/main/resources/images/common/ic_usb@2x.png differ diff --git a/src/main/resources/images/send/ic_exchange.png b/src/main/resources/images/send/ic_exchange.png index 9f01dd6..5ca121b 100644 Binary files a/src/main/resources/images/send/ic_exchange.png and b/src/main/resources/images/send/ic_exchange.png differ diff --git a/src/main/resources/images/send/ic_exchange@2x.png b/src/main/resources/images/send/ic_exchange@2x.png index 902676d..773493f 100644 Binary files a/src/main/resources/images/send/ic_exchange@2x.png and b/src/main/resources/images/send/ic_exchange@2x.png differ diff --git a/src/main/resources/locales/en/messages.yml b/src/main/resources/locales/en/messages.yml index cda36b0..84533e5 100644 --- a/src/main/resources/locales/en/messages.yml +++ b/src/main/resources/locales/en/messages.yml @@ -33,7 +33,7 @@ common: # Onboarding common onboarding: - help_center: Need assistance ? Contact Ledger support team. + help_center: Need assistance? # Navigation bar navigation_bar: @@ -124,8 +124,8 @@ send: place_qr_code: Place the QR code in the center of the image insufficient_funds_title: Insufficient funds insufficient_funds_message: Your account doesn't have enough funds - enable_data_title: ENABLE DATA - enable_data_message: ENABLE DATA MESSAGE + enable_data_title: Cannot add contract data + enable_data_message: Data are not allowed in your device Ethereum app bad_amount_title: Empty amount bad_amount_message: An amount is required to send ethers bad_limit_title: Empty gas limit diff --git a/src/main/resources/templates/wallet/receive.html b/src/main/resources/templates/wallet/receive.html index d998dfa..1380118 100644 --- a/src/main/resources/templates/wallet/receive.html +++ b/src/main/resources/templates/wallet/receive.html @@ -7,7 +7,7 @@

receive.page_title

-
IBAN   {{ctrl.iban}}
+
{{ctrl.iban}}
{{ctrl.address}}
receive.share_qr_code
diff --git a/src/main/resources/templates/wallet/send/index.html b/src/main/resources/templates/wallet/send/index.html index 80972a9..6f7f970 100644 --- a/src/main/resources/templates/wallet/send/index.html +++ b/src/main/resources/templates/wallet/send/index.html @@ -50,7 +50,7 @@

send.page_title

placeholder="{{'send.contract_data_hex' | translate}}" class="small-text-input" type="text" - ng-pattern="/^[0-9A-Fa-fx]+$/" + ng-pattern="/^(0x)?[0-9A-Fa-f]+$/" ng-model="ctrl.data"/> diff --git a/src/main/scala/co/ledger/wallet/web/ethereum/Routes.scala b/src/main/scala/co/ledger/wallet/web/ethereum/Routes.scala index 87ac8b2..340f56c 100644 --- a/src/main/scala/co/ledger/wallet/web/ethereum/Routes.scala +++ b/src/main/scala/co/ledger/wallet/web/ethereum/Routes.scala @@ -43,7 +43,7 @@ object Routes { .when("/onboarding/split-disclaimer/:balance", Route(templateUrl = "/templates/onboarding/split-disclaimer.html")) .when("/account/:id", Route(templateUrl = "/templates/wallet/account.html")) .when("/send", Route(templateUrl = "/templates/wallet/send/index.html")) - .when("/send/:amount/to/:recipient/from/:account_id/with/:fees/price/:price/data/:data", Route(templateUrl = "/templates/wallet/send/perform.html")) + .when("/send/:amount/to/:recipient/from/:account_id/with/:fees/price/:price/data/:data?", Route(templateUrl = "/templates/wallet/send/perform.html")) .when("/receive", Route(templateUrl = "/templates/wallet/receive.html")) .when("/help", Route(templateUrl = "/templates/wallet/help.html")) .otherwise(Route(redirectTo = "/onboarding/launch/animated")) diff --git a/src/main/scala/co/ledger/wallet/web/ethereum/controllers/wallet/SendIndexController.scala b/src/main/scala/co/ledger/wallet/web/ethereum/controllers/wallet/SendIndexController.scala index 49ce8e3..1754fd1 100644 --- a/src/main/scala/co/ledger/wallet/web/ethereum/controllers/wallet/SendIndexController.scala +++ b/src/main/scala/co/ledger/wallet/web/ethereum/controllers/wallet/SendIndexController.scala @@ -72,6 +72,9 @@ class SendIndexController(override val windowService: WindowService, sessionService.currentSession.get.sessionPreferences.lift(SendIndexController.RestoreKey) foreach {(state) => val restore = state.asInstanceOf[SendIndexController.RestoreState] address = restore.to + customGasLimit = restore.customGasLimit + isInAdvancedMode = restore.advancedMode + data = restore.data if (restore.amount.isSuccess) amount = restore.amount.get.toEther.toString() } @@ -162,6 +165,7 @@ class SendIndexController(override val windowService: WindowService, if (data.nonEmpty && !conf.isArbitraryDataSignatureEnabled) { SnackBar.error("send.enable_data_title", "send.enable_data_message").show() } else { + println(s"/send/${value.get.toString()}/to/$address/from/0/with/$fees/price/$gasPrice/data/$data") $location.path(s"/send/${value.get.toString()}/to/$address/from/0/with/$fees/price/$gasPrice/data/$data") $scope.$apply() } @@ -188,7 +192,13 @@ class SendIndexController(override val windowService: WindowService, $scope.$on("$destroy", {() => val amount = Try((BigDecimal($element.find("#amount_input").asInstanceOf[JQLite].`val`().toString) * BigDecimal(10).pow(18)).toBigInt()) val recipient = $element.find("#receiver_input").asInstanceOf[JQLite].`val`().toString - sessionService.currentSession.get.sessionPreferences(SendIndexController.RestoreKey) = SendIndexController.RestoreState(amount.map(new Ether(_)), recipient) + sessionService.currentSession.get.sessionPreferences(SendIndexController.RestoreKey) = SendIndexController.RestoreState( + amount.map(new Ether(_)), + recipient, + customGasLimit, + data, + isInAdvancedMode + ) }) } @@ -196,5 +206,5 @@ object SendIndexController { def init(module: RichModule) = module.controllerOf[SendIndexController]("SendIndexController") val RestoreKey = "SendIndexController#Restore" - case class RestoreState(amount: Try[Ether], to: String) + case class RestoreState(amount: Try[Ether], to: String, customGasLimit: String, data: String, advancedMode: Boolean) } \ No newline at end of file diff --git a/src/main/scala/co/ledger/wallet/web/ethereum/controllers/wallet/SendPerformController.scala b/src/main/scala/co/ledger/wallet/web/ethereum/controllers/wallet/SendPerformController.scala index c678b57..86e2d39 100644 --- a/src/main/scala/co/ledger/wallet/web/ethereum/controllers/wallet/SendPerformController.scala +++ b/src/main/scala/co/ledger/wallet/web/ethereum/controllers/wallet/SendPerformController.scala @@ -56,7 +56,7 @@ class SendPerformController(override val windowService: WindowService, private val accountId = $routeParams("account_id").toInt private val amount = BigInt($routeParams("amount")) private val to = EthereumAccount($routeParams("recipient").trim) - private val data = $routeParams("data").replace("0x", "") + private val data = $routeParams.lift("data").map(_.replace("0x", "")).map(HexUtils.decodeHex) windowService.disableUserInterface() @@ -72,7 +72,7 @@ class SendPerformController(override val windowService: WindowService, from, to, amount, - HexUtils.decodeHex(data) + data.getOrElse(Array.emptyByteArray) ) } }