Skip to content

Commit

Permalink
Merge pull request #3123 from dusk-network/feature-2981
Browse files Browse the repository at this point in the history
web-wallet: Add notice for stake maturity
  • Loading branch information
nortonandreev authored Dec 12, 2024
2 parents 036f1c1 + d666ee8 commit 418c4b6
Show file tree
Hide file tree
Showing 18 changed files with 177 additions and 723 deletions.
3 changes: 3 additions & 0 deletions web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add notice for stake maturity [#2981]

### Changed

- Update Transactions list design [#1922]
Expand Down Expand Up @@ -402,6 +404,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#2920]: https://github.com/dusk-network/rusk/issues/2920
[#2932]: https://github.com/dusk-network/rusk/issues/2932
[#2938]: https://github.com/dusk-network/rusk/issues/2938
[#2981]: https://github.com/dusk-network/rusk/issues/2981
[#2990]: https://github.com/dusk-network/rusk/issues/2990
[#2991]: https://github.com/dusk-network/rusk/issues/2991
[#2994]: https://github.com/dusk-network/rusk/issues/2994
Expand Down
1 change: 1 addition & 0 deletions web-wallet/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions web-wallet/src/lib/components/Send/Send.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import { toast } from "$lib/dusk/components/Toast/store";
import {
Banner,
ContractStatusesList,
GasFee,
GasSettings,
OperationResult,
Expand All @@ -45,9 +44,6 @@
/** @type {bigint} */
export let availableBalance;
/** @type {ContractStatus[]} */
export let statuses;
/** @type {GasStoreContent} */
export let gasLimits;
Expand Down Expand Up @@ -199,7 +195,6 @@
}}
>
<div in:fade|global class="operation__send">
<ContractStatusesList {statuses} />
<div class="operation__address-wrapper">
<p>Address:</p>
<Button
Expand Down Expand Up @@ -268,8 +263,6 @@
}}
>
<div in:fade|global class="operation__send">
<ContractStatusesList {statuses} />

<div class="operation__amount-wrapper">
<p>Amount:</p>
<Button
Expand Down Expand Up @@ -350,8 +343,6 @@
}}
>
<div in:fade|global class="operation__send">
<ContractStatusesList {statuses} />

<Badge
className="operation__review-notice"
text="REVIEW TRANSACTION"
Expand Down
6 changes: 0 additions & 6 deletions web-wallet/src/lib/components/Stake/Stake.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import { toast } from "$lib/dusk/components/Toast/store";
import {
AppAnchor,
ContractStatusesList,
GasFee,
GasSettings,
OperationResult,
Expand Down Expand Up @@ -56,9 +55,6 @@
/** @type {bigint} */
export let availableBalance;
/** @type {ContractStatus[]} */
export let statuses;
let activeStep = 0;
let { gasLimit, gasPrice } = gasSettings;
let hideStakingNoticeNextTime = false;
Expand Down Expand Up @@ -231,7 +227,6 @@
disabled: isNextButtonDisabled,
}}
>
<ContractStatusesList {statuses} />
<div class="operation__amount-wrapper">
<p>Amount:</p>
<Button
Expand Down Expand Up @@ -316,7 +311,6 @@
}}
>
<div in:fade|global class="operation__stake">
<ContractStatusesList {statuses} />
<Badge text="REVIEW TRANSACTION" variant="warning" />
<StakeOverview label="Amount" value={formatter(stakeAmount)} />
<GasFee {formatter} fee={maxGasFee} />
Expand Down
10 changes: 1 addition & 9 deletions web-wallet/src/lib/components/Stake/Unstake.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
Wizard,
WizardStep,
} from "$lib/dusk/components";
import {
ContractStatusesList,
GasSettings,
OperationResult,
} from "$lib/components";
import { GasSettings, OperationResult } from "$lib/components";
import StakeOverview from "./StakeOverview.svelte";
Expand All @@ -38,9 +34,6 @@
/** @type {bigint} */
export let maxAmount;
/** @type {ContractStatus[]} */
export let statuses;
/** @type {string} */
export let operationCtaLabel;
Expand Down Expand Up @@ -111,7 +104,6 @@
}}
>
<div in:fade|global class="operation__unstake">
<ContractStatusesList {statuses} />
<Badge text="REVIEW TRANSACTION" variant="warning" />
<StakeOverview
label={operationOverviewLabel}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<script>
/** @type {bigint} */
export let eligibility;
/** @type {boolean} */
export let isParticipatingInConsensus;
/** @type {(value: number | bigint) => string} */
export let formatter;
</script>

<div class="stake-maturity-info">
{#if isParticipatingInConsensus}
<p class="stake-maturity-info__heading">Actively participating...</p>
<p class="stake-maturity-info__body">
Participation in the consensus began at block #{formatter(eligibility)}.
</p>
{:else}
<p class="stake-maturity-info__heading">Stake maturity in progress...</p>
<p class="stake-maturity-info__body">
Participation in the consensus will start at block #{formatter(
eligibility
)}.
</p>
{/if}
</div>

<style lang="postcss">
.stake-maturity-info {
width: 100%;
padding: 0 0.75em;
padding-top: 0.625em;
&__heading {
font-weight: 500;
line-height: 21px;
letter-spacing: -1;
}
&__body {
font-size: 0.875rem;
line-height: 1.5;
}
}
</style>
6 changes: 0 additions & 6 deletions web-wallet/src/lib/components/__tests__/Send.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ describe("Send", () => {
},
publicAddress,
shieldedAddress,
statuses: [
{
label: "Spendable",
value: "1,000.000000000",
},
],
};

const invalidAddress =
Expand Down
14 changes: 0 additions & 14 deletions web-wallet/src/lib/components/__tests__/Stake.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,6 @@ describe("Stake", () => {
},
hideStakingNotice: true,
minStakeRequirement: 1_234_000_000_000n,
statuses: [
{
label: "Spendable",
value: "1,000.000000000",
},
{
label: "Total Locked",
value: "278.000000000",
},
{
label: "Rewards",
value: "345.000000000",
},
],
};
const baseOptions = {
props: baseProps,
Expand Down
14 changes: 0 additions & 14 deletions web-wallet/src/lib/components/__tests__/Unstake.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,6 @@ describe("Unstake", () => {
gasLimit: 20000000n,
gasPrice: 1n,
},
statuses: [
{
label: "Spendable",
value: "1,000.000000000",
},
{
label: "Total Locked",
value: "278.000000000",
},
{
label: "Rewards",
value: "345.000000000",
},
],
};

afterEach(() => {
Expand Down
Loading

0 comments on commit 418c4b6

Please sign in to comment.