Skip to content

Commit 087b063

Browse files
committed
Display currency code in license price labels
1 parent 216c328 commit 087b063

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

assets/js/androidkey.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class AndroidLicense {
3434
};
3535
paddle.PricePreview(request).then(result => {
3636
this._checkoutData.price = {
37+
currencyCode: result.data.currencyCode,
3738
amount: result.data.details.lineItems[0].totals.total,
3839
formattedAmount: result.data.details.lineItems[0].formattedTotals.total
3940
};

assets/js/desktopkey.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class DesktopLicense {
3636
this._checkoutData.prices = result.data.details.lineItems.map(item => {
3737
return {
3838
priceId: item.price.id,
39+
currencyCode: result.data.currencyCode,
3940
amount: item.totals.total,
4041
formattedAmount: item.formattedTotals.total
4142
}

layouts/partials/android-getkey.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ <h3 class="font-h3 text-lg">{{ i18n "android_getkey_title" }}</h3>
55

66
<form x-show="!checkoutData.success" x-ref="form" class="px-4 py-8" @submit.prevent="checkoutData.acceptNewsletter && subscribeToNewsletter(checkoutData.email, 'cryptomator', checkoutData.captcha); androidLicense.checkout('{{ .Site.Language.Lang }}'); $refs.captcha.reset()">
77
<div class="mb-4">
8-
<label class="label-uppercase mb-2">{{ i18n "android_getkey_price" }}</label>
8+
<label class="label-uppercase mb-2">
9+
{{ i18n "android_getkey_price" }}
10+
<span x-show="checkoutData.price" x-cloak>
11+
(in <span x-text="checkoutData.price ? checkoutData.price.currencyCode : ''"></span>)
12+
</span>
13+
</label>
914
<div class="relative input-box flex items-center gap-2 w-full lg:w-1/2">
1015
<span x-show="checkoutData.discountedPrice && checkoutData.price" x-text="checkoutData.price ? checkoutData.price.formattedAmount : '…'" class="text-gray-500 line-through decoration-red-600" x-cloak></span>
1116
<span x-text="checkoutData.discountedPrice ? checkoutData.discountedPrice.formattedAmount : checkoutData.price ? checkoutData.price.formattedAmount : '…'"></span>

layouts/partials/supporter-cert-funder.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
<form x-show="!checkoutData.success" x-ref="funderForm" @submit.prevent="checkoutData.acceptNewsletter && subscribeToNewsletter(checkoutData.email, 'cryptomator', checkoutData.captcha); desktopLicense.checkout(checkoutData.prices[checkoutData.selectedPriceIndex].priceId, '{{ .Site.Language.Lang }}'); $refs.captcha.reset()">
33
<div class="flex flex-wrap md:flex-nowrap">
44
<fieldset class="w-full mb-4 md:w-2/3 md:pr-3">
5-
<legend class="label-uppercase mb-2">{{ i18n "supporter_cert_funder_price" }}</legend>
5+
<legend class="label-uppercase mb-2">
6+
{{ i18n "supporter_cert_funder_price" }}
7+
<span x-show="checkoutData.prices[checkoutData.selectedPriceIndex]?.currencyCode" x-cloak>
8+
(in <span x-text="checkoutData.prices[checkoutData.selectedPriceIndex].currencyCode"></span>)
9+
</span>
10+
</legend>
611
<div class="grid grid-cols-3 gap-2 mb-2">
712
<template x-for="(price, index) in checkoutData.prices">
813
<label :class="{'border-gray-300 hover:border-primary': checkoutData.selectedPriceIndex != index, 'border-primary bg-primary text-white': checkoutData.selectedPriceIndex == index}" class="relative flex items-center justify-center rounded-sm px-3 py-2 cursor-pointer border focus:ring-0 focus:border-secondary" @click="checkoutData.selectedPriceIndex = index">

0 commit comments

Comments
 (0)