Skip to content

Commit 97f0773

Browse files
arhtudormorarmgavrilaiuliacimpeanuMiroMargineanu
authored
Gas price option replacement for ppu (#256)
* 0.0.36 (#251) * Storybook Deployment Setup (#248) * Added Storybook deployment workflow * Added secrets references * Added workflow dependency to run the GitHub action * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed storybook build rendering on server * Fixed type in main * Added comments to converter * Updated CHANGELOG.md * Updated deployment branch * Fixed build * Removed lit * Fixed build * Updated deployment branch * Updated deployment branch * Remove lit --------- Co-authored-by: Tudor Morar <tudor.morar@multiversx.com> * Refactor components in transactions table (#243) * Updated styles * Removed unused styles * Removed unused styles * Updated styles * Updated CHANGELOG.md * Updated icons * Removed unused icons * Updated styles * Updated styles * Updated styles * Updated styles * Updated shards arrow styles * Added icons to replace Fontawesome * Updated styles * Fixed tests * Updated styles on transactions table * Refactored FontAwesome icons * Fixed test * Updated scrollbar styles * Fixes after review. * Removed FontAwesome packages * Updated icons * Fixed tests * Fixes * Fixes. * Fixes * Refactored transaction-age * Updated changelog * Fixed path * Removed transaction-direction-badge component not used * Refactored transaction-hash comp * Refactored components from transactions-table * Refactored classNames * Updated changelog * Fixed tests * Fixed tests * Updated TransactionIcon * Updated TransactionIcon * Updated default icon * Fixes * Fixes --------- Co-authored-by: Miro Mărgineanu <miro.margineanu@multiversx.com> * Updated icons type (#250) * Fixed icon name * Fixed name * Updated truncate * Updated changelog * Updated icons * Fixed tests * Fixes * Fixed casts * Fixed errors * v0.0.36 --------- Co-authored-by: Miro <miro.margineanu@multiversx.com> Co-authored-by: Tudor Morar <tudor.morar@multiversx.com> * Changed ppu to gasPriceOption * Update CHANGELOG * 0.1.0 * Update CHANGELOG * Update CHANGELOG * 0.0.36 (#251) * Storybook Deployment Setup (#248) * Added Storybook deployment workflow * Added secrets references * Added workflow dependency to run the GitHub action * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed storybook build rendering on server * Fixed type in main * Added comments to converter * Updated CHANGELOG.md * Updated deployment branch * Fixed build * Removed lit * Fixed build * Updated deployment branch * Updated deployment branch * Remove lit --------- Co-authored-by: Tudor Morar <tudor.morar@multiversx.com> * Refactor components in transactions table (#243) * Updated styles * Removed unused styles * Removed unused styles * Updated styles * Updated CHANGELOG.md * Updated icons * Removed unused icons * Updated styles * Updated styles * Updated styles * Updated styles * Updated shards arrow styles * Added icons to replace Fontawesome * Updated styles * Fixed tests * Updated styles on transactions table * Refactored FontAwesome icons * Fixed test * Updated scrollbar styles * Fixes after review. * Removed FontAwesome packages * Updated icons * Fixed tests * Fixes * Fixes. * Fixes * Refactored transaction-age * Updated changelog * Fixed path * Removed transaction-direction-badge component not used * Refactored transaction-hash comp * Refactored components from transactions-table * Refactored classNames * Updated changelog * Fixed tests * Fixed tests * Updated TransactionIcon * Updated TransactionIcon * Updated default icon * Fixes * Fixes --------- Co-authored-by: Miro Mărgineanu <miro.margineanu@multiversx.com> * Updated icons type (#250) * Fixed icon name * Fixed name * Updated truncate * Updated changelog * Updated icons * Fixed tests * Fixes * Fixed casts * Fixed errors * v0.0.36 --------- Co-authored-by: Miro <miro.margineanu@multiversx.com> Co-authored-by: Tudor Morar <tudor.morar@multiversx.com> * Bring back files --------- Co-authored-by: Gavrila Andrei <andrei.gavrila@multiversx.com> Co-authored-by: Iulia Cimpeanu <72752718+iuliacimpeanu@users.noreply.github.com> Co-authored-by: Miro <miro.margineanu@multiversx.com>
1 parent a2d9468 commit 97f0773

File tree

6 files changed

+19
-40
lines changed

6 files changed

+19
-40
lines changed

CHANGELOG.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- [Changed ppu to gasPriceOption in sign transactions panel](https://github.com/multiversx/mx-sdk-dapp-ui/pull/255)
1313
- [Fixed main conflicts with main branch](https://github.com/multiversx/mx-sdk-dapp-ui/pull/257)
14-
1514
- [Added enum for transaction status](https://github.com/multiversx/mx-sdk-dapp-ui/pull/254)
16-
1715
- [Fixed icons on batch transactions toast](https://github.com/multiversx/mx-sdk-dapp-ui/pull/253)
18-
1916
- [Fixed finished toasts loader](https://github.com/multiversx/mx-sdk-dapp-ui/pull/252)
20-
2117
- [Refactored utility components](https://github.com/multiversx/mx-sdk-dapp-ui/pull/249)
2218

2319
## [[0.0.36](https://github.com/multiversx/mx-sdk-dapp-ui/pull/251)] - 2025-10-15
2420

2521
- [Updated icons type](https://github.com/multiversx/mx-sdk-dapp-ui/pull/250)
26-
2722
- [Added the Storybook as a live server deployment](https://github.com/multiversx/mx-sdk-dapp-ui/pull/248)
28-
23+
- [Updated icons type](https://github.com/multiversx/mx-sdk-dapp-ui/pull/250)
24+
- [Added the Storybook as a live server deployment](https://github.com/multiversx/mx-sdk-dapp-ui/pull/248)
2925
- [Refactor components in transactions table](https://github.com/multiversx/mx-sdk-dapp-ui/pull/243)
3026

3127
## [[0.0.35](https://github.com/multiversx/mx-sdk-dapp-ui/pull/246)] - 2025-10-10

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@multiversx/sdk-dapp-ui",
3-
"version": "0.0.36",
3+
"version": "0.1.0",
44
"description": "A library to hold UI components for a dApp on the MultiversX blockchain",
55
"author": "MultiversX",
66
"license": "MIT",
@@ -132,4 +132,4 @@
132132
"typescript": "^5.7.3",
133133
"vite": "^7.0.6"
134134
}
135-
}
135+
}

src/components/functional/sign-transactions-panel/components/sign-transactions-advanced/sign-transactions-advanced.tsx

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,9 @@ export class SignTransactionsAdvanced {
1919
this.decodeMethod = method;
2020
}
2121

22-
get pricePerUnitOption() {
23-
const {
24-
commonData: { ppu, ppuOptions },
25-
} = state;
26-
27-
if (ppuOptions.length === 0) {
28-
return ppu;
29-
}
30-
31-
const currentOption = ppuOptions.find(option => option.value === ppu);
32-
return currentOption.value;
33-
}
34-
3522
render() {
3623
const {
37-
commonData: { needsSigning, ppuOptions, gasLimit, gasPrice, egldLabel },
24+
commonData: { needsSigning, gasPriceOptions, gasLimit, gasPrice, egldLabel, gasPriceOption },
3825
} = state;
3926

4027
return (
@@ -48,15 +35,15 @@ export class SignTransactionsAdvanced {
4835
</span>
4936
</div>
5037
<div class="gas-speed-selector" data-testid={DataTestIdsEnum.signTransactionsAdvancedGasSpeedSelector}>
51-
{ppuOptions.map(ppuOption => (
38+
{gasPriceOptions.map(({ label, value }) => (
5239
<button
53-
key={ppuOption.label}
40+
key={label}
5441
disabled={!needsSigning}
55-
class={`speed-option ${this.pricePerUnitOption === ppuOption.value ? 'active' : ''}`}
42+
class={`speed-option ${gasPriceOption.toString() === value.toString() ? 'active' : ''}`}
5643
data-testid={DataTestIdsEnum.signTransactionsAdvancedSpeedOption}
57-
onClick={() => state.setPpuOption(ppuOption.value)}
44+
onClick={() => state.setGasPriceOption(value)}
5845
>
59-
<span class="speed-text">{ppuOption.label}</span>
46+
<span class="speed-text">{label}</span>
6047
</button>
6148
))}
6249
</div>

src/components/functional/sign-transactions-panel/sign-transactions-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ export class SignTransactionsPanel {
5050
this.eventBus.publish(SignEventsEnum.BACK);
5151
};
5252

53-
state.setPpuOption = (ppu: number) => {
54-
this.eventBus.publish(SignEventsEnum.SET_PPU, ppu);
53+
state.setGasPriceOption = (gasPriceOption: number) => {
54+
this.eventBus.publish(SignEventsEnum.SET_GAS_PRICE_OPTION, gasPriceOption);
5555
};
5656
}
5757

src/components/functional/sign-transactions-panel/sign-transactions-panel.types.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ export interface ISignTransactionsPanelCommonData {
2020
receiverIcon?: string;
2121
data?: string;
2222
decodedData?: Partial<Record<DecodeMethodEnum, DecodedDisplayType>>;
23-
gasPrice?: string;
24-
/**
25-
* ppu - Price Per Unit
26-
* a constant that is used to calculate the gas price inside `recommendGasPrice`
27-
*/
28-
ppu?: number;
29-
ppuOptions: {
23+
gasPrice?: string; // formatted gas price
24+
gasPriceOption?: number;
25+
gasPriceOptions: {
3026
label: string;
3127
value: number;
3228
}[];
@@ -81,7 +77,7 @@ export enum SignEventsEnum {
8177
BACK = 'BACK_SIGN_TRANSACTIONS',
8278
NEXT = 'NEXT_SIGN_TRANSACTIONS',
8379
DATA_UPDATE = 'DATA_UPDATE_SIGN_TRANSACTIONS',
84-
SET_PPU = 'SET_PPU_SIGN_TRANSACTIONS',
80+
SET_GAS_PRICE_OPTION = 'SET_GAS_PRICE_OPTION_SIGN_TRANSACTIONS',
8581
CLOSE = 'CLOSE_SIGN_TRANSACTIONS',
8682
}
8783

src/components/functional/sign-transactions-panel/signTransactionsPanelStore.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface ITransactionState extends ISignTransactionsPanelData {
77
onBack: () => void;
88
onNext: () => void;
99
onConfirm: () => void;
10-
setPpuOption: (ppu: number) => void;
10+
setGasPriceOption: (gasPriceOption: number) => void;
1111
}
1212

1313
const initialState: ITransactionState = {
@@ -23,7 +23,7 @@ const initialState: ITransactionState = {
2323
currentIndex: 0,
2424
currentIndexToSign: 0,
2525
receiver: '',
26-
ppuOptions: [],
26+
gasPriceOptions: [],
2727
origin: '',
2828
},
2929
nftTransaction: null,
@@ -33,7 +33,7 @@ const initialState: ITransactionState = {
3333
onBack: null,
3434
onNext: null,
3535
onConfirm: null,
36-
setPpuOption: null,
36+
setGasPriceOption: null,
3737
};
3838

3939
const store = createStore<ITransactionState>({

0 commit comments

Comments
 (0)