-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Part of #17670: Replace Typography with Text component in CancelSpeedupPopover #18638
Merged
georgewrmarshall
merged 18 commits into
MetaMask:develop
from
kremalicious:feature/17670-cancel-speedup-popover
Jun 26, 2023
Merged
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1b41e2c
create story
kremalicious fd959f5
replace Typography with Text component
kremalicious a4b1d55
review changes
kremalicious 568a932
strong tag support within Text component
kremalicious e0c6db3
replace `strong` with new `Text as="strong"`
kremalicious 62cc742
remove unneccessary css from fa564e3f036f1439f9f220cca23595b508760614
kremalicious 2008ada
add text variant definition
kremalicious 23b9e6a
Updating text variant of button
georgewrmarshall 23626ad
restrore proper spacing between elements
kremalicious 31992b8
Merge branch 'develop' into feature/17670-cancel-speedup-popover
georgewrmarshall cfc1b49
Merge branch 'develop' into feature/17670-cancel-speedup-popover
kremalicious ac5922e
Merge branch 'develop' into feature/17670-cancel-speedup-popover
kremalicious bc03fb3
Merge branch 'develop' into feature/17670-cancel-speedup-popover
georgewrmarshall e8074f0
Merge branch 'develop' into feature/17670-cancel-speedup-popover
garrettbear 73307fd
Quick fix for test
georgewrmarshall a6fb0dd
Merge branch 'develop' into feature/17670-cancel-speedup-popover
georgewrmarshall a0f3ea7
Adding key
georgewrmarshall bdd3844
Merge branch 'develop' into feature/17670-cancel-speedup-popover
georgewrmarshall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
ui/components/app/cancel-speedup-popover/cancel-speedup-popover.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import React from 'react'; | ||
import { Provider } from 'react-redux'; | ||
import BigNumber from 'bignumber.js'; | ||
import configureStore from '../../../store/store'; | ||
import { TransactionModalContext } from '../../../contexts/transaction-modal'; | ||
import mockEstimates from '../../../../test/data/mock-estimates.json'; | ||
import mockState from '../../../../test/data/mock-state.json'; | ||
import { | ||
EditGasModes, | ||
GasEstimateTypes, | ||
} from '../../../../shared/constants/gas'; | ||
import { decGWEIToHexWEI } from '../../../../shared/modules/conversion.utils'; | ||
import { GasFeeContextProvider } from '../../../contexts/gasFee'; | ||
import CancelSpeedupPopover from './cancel-speedup-popover'; | ||
|
||
const store = configureStore({ | ||
metamask: { | ||
...mockState.metamask, | ||
accounts: { | ||
[mockState.metamask.selectedAddress]: { | ||
address: mockState.metamask.selectedAddress, | ||
balance: '0x1F4', | ||
}, | ||
}, | ||
gasFeeEstimates: mockEstimates[GasEstimateTypes.feeMarket].gasFeeEstimates, | ||
}, | ||
}); | ||
|
||
const MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_DEC_GWEI = | ||
mockEstimates[GasEstimateTypes.feeMarket].gasFeeEstimates.medium | ||
.suggestedMaxFeePerGas; | ||
|
||
const MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI = new BigNumber( | ||
decGWEIToHexWEI(MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_DEC_GWEI), | ||
16, | ||
); | ||
|
||
const MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_HEX_WEI = | ||
MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_BN_WEI.toString(16); | ||
|
||
export default { | ||
title: 'Components/App/CancelSpeedupPopover', | ||
component: CancelSpeedupPopover, | ||
decorators: [ | ||
(story) => ( | ||
<Provider store={store}> | ||
<GasFeeContextProvider | ||
transaction={{ | ||
userFeeLevel: 'tenPercentIncreased', | ||
txParams: { | ||
gas: '0x5208', | ||
maxFeePerGas: MOCK_SUGGESTED_MEDIUM_MAXFEEPERGAS_HEX_WEI, | ||
maxPriorityFeePerGas: '0x59682f00', | ||
}, | ||
}} | ||
editGasMode={EditGasModes.cancel} | ||
> | ||
<TransactionModalContext.Provider | ||
value={{ | ||
closeModal: () => undefined, | ||
currentModal: 'cancelSpeedUpTransaction', | ||
}} | ||
> | ||
{story()} | ||
</TransactionModalContext.Provider> | ||
</GasFeeContextProvider> | ||
</Provider> | ||
), | ||
], | ||
}; | ||
|
||
export const DefaultStory = (args) => { | ||
return ( | ||
<div style={{ width: '600px' }}> | ||
<CancelSpeedupPopover {...args} /> | ||
</div> | ||
); | ||
}; | ||
|
||
DefaultStory.storyName = 'Default'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the choice to remove the in favor of a fragment related to the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not particularly related to the issue but could have some minor performance benefits as there are no utility props being used on the
Box
so could save a small amount of render time?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool