feat: add smooth scrolling to rewards tab on donate button click

This commit is contained in:
Santiago Nahuel de la Fuente
2025-08-18 10:40:11 -03:00
parent db0959e6ab
commit 01e46e8ebf
+11
View File
@@ -23,6 +23,16 @@
accountingBalance.balance?.amount !== undefined &&
project.budget?.minimum?.money?.amount !== undefined &&
Number(accountingBalance.balance.amount) - Number(project.budget.minimum.money.amount) > 0;
function scrollToRewards() {
const rewardsElement = document.getElementById("tab-rewards");
if (rewardsElement) {
rewardsElement.scrollIntoView({
behavior: "smooth",
block: "start",
});
}
}
</script>
<div
@@ -77,6 +87,7 @@
</div>
<button
class="bg-primary bold text-tertiary w-full cursor-pointer rounded-3xl px-6 py-4 font-bold"
on:click={scrollToRewards}
>
{$t("campaignProgress.donate")}
</button>