From e213ea77bdd1beb7512a430ff6473ce73163368b Mon Sep 17 00:00:00 2001
From: dragana8 <92531782+dragana8@users.noreply.github.com>
Date: Tue, 4 Jan 2022 20:23:57 +0100
Subject: [PATCH] EditGasPopover story: convert knobs and actions to controls /
args #13056 (#13125)
---
.../edit-gas-popover.stories.js | 100 ++++++------------
1 file changed, 34 insertions(+), 66 deletions(-)
diff --git a/ui/components/app/edit-gas-popover/edit-gas-popover.stories.js b/ui/components/app/edit-gas-popover/edit-gas-popover.stories.js
index 24405f15b..80a78998c 100644
--- a/ui/components/app/edit-gas-popover/edit-gas-popover.stories.js
+++ b/ui/components/app/edit-gas-popover/edit-gas-popover.stories.js
@@ -1,7 +1,5 @@
import React from 'react';
import { Provider } from 'react-redux';
-import { action } from '@storybook/addon-actions';
-import { boolean } from '@storybook/addon-knobs';
import { decGWEIToHexWEI } from '../../../helpers/utils/conversions.util';
import configureStore from '../../../store/store';
import testData from '../../../../.storybook/test-data';
@@ -18,78 +16,48 @@ export default {
title: 'Components/App/EditGasPopover',
decorators: [(story) => {story()}],
id: __filename,
+ argTypes: {
+ editGasDisplayProps: {
+ control: 'object',
+ },
+ transaction: {
+ control: 'object',
+ },
+ defaultEstimateToUse: { control: 'text' },
+ mode: { control: 'text' },
+ confirmButtonText: { control: 'text' },
+ minimumGasLimit: { control: 'text' },
+ onClose: { action: 'Close Edit Gas Popover' },
+ },
};
-export const DefaultStory = () => {
- return (
-
- action(`Close Edit Gas Popover`)()}
- minimumGasLimit="5700"
- />
-
- );
+const transaction = {
+ userFeeLevel: GAS_RECOMMENDATIONS.MEDIUM,
+ txParams: {
+ maxFeePerGas: decGWEIToHexWEI('10000'),
+ maxPriorityFeePerGas: '0x5600',
+ gas: `0x5600`,
+ gasPrice: '0x5600',
+ },
};
+const defaultEstimateToUse = GAS_RECOMMENDATIONS.HIGH;
+const mode = EDIT_GAS_MODES.SWAPS;
+const confirmButtonText = 'Submit';
+const minimumGasLimit = '5700';
-DefaultStory.storyName = 'Default';
-
-export const WithDifferentButtonText = () => {
+export const DefaultStory = (args) => {
return (
- action(`Close Edit Gas Popover`)()}
- minimumGasLimit="5700"
- />
+
);
};
-export const WithEducationalContentFlow = () => {
- return (
-
- action(`Close Edit Gas Popover`)()}
- minimumGasLimit="5700"
- />
-
- );
+DefaultStory.storyName = 'Default';
+DefaultStory.args = {
+ transaction,
+ defaultEstimateToUse,
+ mode,
+ confirmButtonText,
+ minimumGasLimit,
};