diff --git a/src/components/RewardModal.svelte b/src/components/RewardModal.svelte new file mode 100644 index 00000000..12c4cd38 --- /dev/null +++ b/src/components/RewardModal.svelte @@ -0,0 +1,169 @@ + + + +
+
+

+ {@html $t( + "rewards.by-amount-or-more", + { + amount: `${formatCurrency(reward.money.amount, reward.money.currency)}`, + }, + { allowHTML: true }, + )} +

+

{$t("rewards.thanks-message")}

+
+
+
+

+ {#await renderMarkdown(reward.description!) then content} + {@html content} + {/await} +

+

+ {@html $t( + "rewards.reward-iva-message", + { + link: `${window.location.origin}${link}`, + }, + { allowHTML: true }, + )} +

+
+ { + rawInput = customAmount.toString(); + }} + onblur={() => { + const currency = reward?.money?.currency!; + const unit = getUnit(currency); + + const parsed = parseFloat( + rawInput.replace(/[^\d.,]/g, "").replace(",", "."), + ); + customAmount = isNaN(parsed) ? 0 : parsed; + + rawInput = + customAmount > 0 + ? formatCurrency(customAmount * unit, currency) + : ""; + }} + placeholder={$t("rewards.donation-free.placeholder")} + /> +
+
+
+
+
+ + + {@html $t( + "rewards.donators", + { donators: reward.unitsClaimed! }, + { allowHTML: true }, + )} + +
+ {#if reward.isFinite} +
+ + + {@html $t( + "rewards.units-available", + { units: reward.unitsAvailable! }, + { allowHTML: true }, + )} + +
+ {/if} +
+
+ + +
+
+
diff --git a/src/components/TopReward.svelte b/src/components/TopReward.svelte new file mode 100644 index 00000000..884d75db --- /dev/null +++ b/src/components/TopReward.svelte @@ -0,0 +1,50 @@ + + +
  • +
    +

    + {reward.title} +

    + + {#if reward.description} +
    + {#await renderMarkdown(reward.description) then description} + {@html description} + {/await} +
    + {/if} +
    + + +
  • + diff --git a/src/components/project/SingleProject.svelte b/src/components/project/SingleProject.svelte index 0770dfc9..3b2a1534 100644 --- a/src/components/project/SingleProject.svelte +++ b/src/components/project/SingleProject.svelte @@ -1,11 +1,11 @@ + +