Skip to content

Commit

Permalink
chore: fixing story and removing changes to other storybook files
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewrmarshall committed Sep 11, 2024
1 parent 7dc6362 commit 1b1e99e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import React, { useContext, useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import { GasEstimateTypes } from '../../../../../shared/constants/gas';
import { Box, Text } from '../../../../components/component-library';
import Typography from '../../../../components/ui/typography/typography';
import { useGasFeeContext } from '../../../../contexts/gasFee';
import { I18nContext } from '../../../../contexts/i18n';
import {
Expand All @@ -19,7 +18,6 @@ import {
FontWeight,
TextColor,
TextVariant,
TypographyVariant,
} from '../../../../helpers/constants/design-system';
import {
GAS_FORM_ERRORS,
Expand Down Expand Up @@ -113,13 +111,13 @@ export default function GasTiming({
gasWarnings?.maxFee === GAS_FORM_ERRORS.MAX_FEE_TOO_LOW
) {
return (
<Typography
variant={TypographyVariant.H7}
<Text
variant={TextVariant.bodySm}
fontWeight={FontWeight.Bold}
className={classNames('gas-timing', 'gas-timing--negative')}
>
{t('editGasTooLow')}
</Typography>
</Text>
);
}

Expand Down Expand Up @@ -178,16 +176,12 @@ export default function GasTiming({

return (
<Box display={Display.Flex} flexWrap={FlexWrap.Wrap}>
<Text
color={TextColor.textAlternative}
variant={TextVariant.bodyMd}
paddingInlineEnd={1}
>
<Text color={TextColor.textAlternative} paddingInlineEnd={1}>
{text}
</Text>

{time && (
<Text variant={TextVariant.bodyMd} color={TextColor.textDefault}>
<Text>
<span data-testid="gas-timing-time">~{time}</span>
</Text>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Provider } from 'react-redux';
import configureStore from '../../../../store/store';
import GasTiming from './gas-timing.component';
import mockState from '../../../../../test/data/mock-state.json';
import { GAS_FORM_ERRORS } from '../../../../helpers/constants/gas';

const storeMock = configureStore({
metamask: {
Expand Down Expand Up @@ -33,8 +34,8 @@ const meta: Meta<typeof GasTiming> = {
},
},
args: {
maxFeePerGas: 0,
maxPriorityFeePerGas: 0,
maxFeePerGas: '0',
maxPriorityFeePerGas: '0',
gasWarnings: {},
},
};
Expand All @@ -45,3 +46,16 @@ type Story = StoryObj<typeof GasTiming>;
export const DefaultStory: Story = {};

DefaultStory.storyName = 'Default';

export const GasTooLowStory: Story = {
args: {
maxFeePerGas: '1', // Simulate low gas fee
maxPriorityFeePerGas: '1', // Simulate low priority fee
gasWarnings: {
maxPriorityFee: GAS_FORM_ERRORS.MAX_PRIORITY_FEE_TOO_LOW,
maxFee: GAS_FORM_ERRORS.MAX_FEE_TOO_LOW,
},
},
};

GasTooLowStory.storyName = 'GasTooLow';

0 comments on commit 1b1e99e

Please sign in to comment.