2020-10-06 20:28:38 +02:00
|
|
|
import React from 'react'
|
|
|
|
import { action } from '@storybook/addon-actions'
|
2020-12-08 17:47:53 +01:00
|
|
|
import { text, boolean, number, object } from '@storybook/addon-knobs'
|
2020-10-06 20:28:38 +02:00
|
|
|
import FeeCard from './fee-card'
|
|
|
|
|
2020-10-16 17:59:32 +02:00
|
|
|
const tokenApprovalTextComponent = (
|
2020-11-03 00:41:28 +01:00
|
|
|
<span key="swaps-view-quote-approve-symbol-1" className="view-quote__bold">
|
2020-10-16 17:59:32 +02:00
|
|
|
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
|
|
|
}}
|
2020-10-16 17:59:32 +02:00
|
|
|
onFeeCardMaxRowClick={action('Clicked max fee row link')}
|
|
|
|
tokenApprovalTextComponent={tokenApprovalTextComponent}
|
|
|
|
tokenApprovalSourceTokenSymbol="ABC"
|
|
|
|
onTokenApprovalClick={action('Clicked third row link')}
|
|
|
|
hideTokenApprovalRow={false}
|
2020-12-08 17:47:53 +01:00
|
|
|
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
|
|
|
}}
|
2020-10-16 17:59:32 +02:00
|
|
|
onFeeCardMaxRowClick={action('Clicked max fee row link')}
|
|
|
|
hideTokenApprovalRow
|
2020-12-08 17:47:53 +01:00
|
|
|
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
|
|
|
}}
|
2020-10-16 17:59:32 +02:00
|
|
|
onFeeCardMaxRowClick={action('Clicked max fee row link')}
|
|
|
|
hideTokenApprovalRow
|
2020-12-08 17:47:53 +01:00
|
|
|
metaMaskFee="0.875"
|
|
|
|
onQuotesClick={action('Clicked quotes link')}
|
|
|
|
numberOfQuotes={2}
|
2020-10-06 20:28:38 +02:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|