Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Create a story for GasTiming component #25557

Merged
merged 15 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,6 @@ licenseInfos.json
# API Spec tests
html-report/

# Ignore untracked files for PR
app/images/gas-timing.png
ui/__mocks__/storeMock.js
georgewrmarshall marked this conversation as resolved.
Show resolved Hide resolved
Binary file added .storybook/images/gas-timing.png
georgewrmarshall marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { Provider } from 'react-redux';
import { storeMock } from '../../../../__mocks__/storeMock';
import GasTiming from './gas-timing.component';

const meta: Meta<typeof GasTiming> = {
title: 'Components/Confirmations/GasTiming',
georgewrmarshall marked this conversation as resolved.
Show resolved Hide resolved
component: GasTiming,
decorators: [
(StoryComponent: React.FC) => (
<Provider store={storeMock}>
<StoryComponent />
</Provider>
),
],
argTypes: {
maxFeePerGas: {
control: 'number',
},
maxPriorityFeePerGas: {
control: 'number',
},
gasWarnings: {
control: 'object',
},
},
args: {
maxFeePerGas: 0,
maxPriorityFeePerGas: 0,
gasWarnings: {},
},
};

export default meta;
type Story = StoryObj<typeof GasTiming>;

export const DefaultStory: Story = {};

DefaultStory.storyName = 'Default';