1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-21 00:43:21 +01:00
metamask-extension/ui/app/pages/swaps/fee-card/fee-card.stories.js

92 lines
2.6 KiB
JavaScript
Raw Normal View History

2020-10-06 20:28:38 +02:00
import React from 'react'
import { action } from '@storybook/addon-actions'
import { text, boolean, number, object } from '@storybook/addon-knobs'
2020-10-06 20:28:38 +02:00
import FeeCard from './fee-card'
const tokenApprovalTextComponent = (
2020-11-03 00:41:28 +01:00
<span key="swaps-view-quote-approve-symbol-1" className="view-quote__bold">
ABC
</span>
)
2020-10-06 20:28:38 +02:00
const containerStyle = {
width: '300px',
}
export default {
title: 'FeeCard',
}
export const WithAllProps = () => {
return (
<div style={containerStyle}>
<FeeCard
feeRowText={text('feeRowText', 'Network fees')}
2020-11-03 00:41:28 +01:00
primaryFee={{
2020-10-06 20:28:38 +02:00
fee: text('primaryFee', '1 ETH'),
maxFee: text('primaryMaxFee', '2 ETH'),
2020-11-03 00:41:28 +01:00
}}
secondaryFee={{
2020-10-06 20:28:38 +02:00
fee: text('secondaryFee', '100 USD'),
maxFee: text('secondaryMaxFee', '200 USD'),
2020-11-03 00:41:28 +01:00
}}
onFeeCardMaxRowClick={action('Clicked max fee row link')}
tokenApprovalTextComponent={tokenApprovalTextComponent}
tokenApprovalSourceTokenSymbol="ABC"
onTokenApprovalClick={action('Clicked third row link')}
hideTokenApprovalRow={false}
metaMaskFee="0.875"
savings={object('savings 1', { total: '8.55' })}
onQuotesClick={action('Clicked quotes link')}
numberOfQuotes={number('numberOfQuotes', 6)}
isBestQuote={boolean('isBestQuote', true)}
conversionRate={300}
currentCurrency="usd"
2020-10-06 20:28:38 +02:00
/>
</div>
)
}
export const WithoutThirdRow = () => {
return (
<div style={containerStyle}>
<FeeCard
feeRowText={text('feeRowText', 'Network fees')}
2020-11-03 00:41:28 +01:00
primaryFee={{
2020-10-06 20:28:38 +02:00
fee: text('primaryFee', '1 ETH'),
maxFee: text('primaryMaxFee', '2 ETH'),
2020-11-03 00:41:28 +01:00
}}
secondaryFee={{
2020-10-06 20:28:38 +02:00
fee: text('secondaryFee', '100 USD'),
maxFee: text('secondaryMaxFee', '200 USD'),
2020-11-03 00:41:28 +01:00
}}
onFeeCardMaxRowClick={action('Clicked max fee row link')}
hideTokenApprovalRow
onQuotesClick={action('Clicked quotes link')}
numberOfQuotes={number('numberOfQuotes', 1)}
isBestQuote={boolean('isBestQuote', true)}
savings={object('savings 1', { total: '8.55' })}
metaMaskFee="0.875"
2020-10-06 20:28:38 +02:00
/>
</div>
)
}
export const WithOnlyRequiredProps = () => {
return (
<div style={containerStyle}>
<FeeCard
2020-11-03 00:41:28 +01:00
primaryFee={{
2020-10-06 20:28:38 +02:00
fee: text('primaryFee', '1 ETH'),
maxFee: text('primaryMaxFee', '2 ETH'),
2020-11-03 00:41:28 +01:00
}}
onFeeCardMaxRowClick={action('Clicked max fee row link')}
hideTokenApprovalRow
metaMaskFee="0.875"
onQuotesClick={action('Clicked quotes link')}
numberOfQuotes={2}
2020-10-06 20:28:38 +02:00
/>
</div>
)
}