Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Commit

Permalink
New UI integration done
Browse files Browse the repository at this point in the history
  • Loading branch information
pollastri-pierre committed Oct 26, 2016
1 parent 103ff57 commit b41fa52
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 16 deletions.
13 changes: 8 additions & 5 deletions src/main/assets/stylesheets/components/lbutton.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
justify-content: center;
align-items: center;
flex-direction: column;
border-radius: 12px;
border-radius: 16px;
cursor: pointer;
margin-left: 10px;

Expand All @@ -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;
}

Expand Down
Binary file modified src/main/resources/images/common/ic_error_big_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/common/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/common/ic_usb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/common/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/send/ic_exchange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/send/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/main/resources/locales/en/messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ common:

# Onboarding common
onboarding:
help_center: Need assistance ? Contact Ledger support team.
help_center: Need assistance?

# Navigation bar
navigation_bar:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/wallet/receive.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1 translate>receive.page_title</h1>
<div>
<qrcodeviewer value="ctrl.uri"></qrcodeviewer>
<selector class="medium-top-margin" values="{{ctrl.formats}}" selected="{{ctrl.currentFormat}}" changed="ctrl.onFormatChanged(value)" ></selector>
<div ng-show="ctrl.showIban" class="small-top-margin regular-text"><b class="uppercase-section-column">IBAN</b> &nbsp;&nbsp;<span class="selectable">{{ctrl.iban}}</span></div>
<div ng-show="ctrl.showIban" class="small-top-margin regular-text"><span class="selectable">{{ctrl.iban}}</span></div>
<div ng-show="ctrl.showHex" class="small-top-margin regular-text selectable">{{ctrl.address}}</div>
<div class="almost-small-top-margin regular-grey-text-small" translate>receive.share_qr_code</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/wallet/send/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h1 translate>send.page_title</h1>
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"/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/co/ledger/wallet/web/ethereum/Routes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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()
}
Expand All @@ -188,13 +192,19 @@ 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
)
})
}

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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -72,7 +72,7 @@ class SendPerformController(override val windowService: WindowService,
from,
to,
amount,
HexUtils.decodeHex(data)
data.getOrElse(Array.emptyByteArray)
)
}
}
Expand Down

0 comments on commit b41fa52

Please sign in to comment.