You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.6 KiB
92 lines
2.6 KiB
4 years ago
|
import React from 'react';
|
||
|
import { action } from '@storybook/addon-actions';
|
||
|
import { text, boolean, number, object } from '@storybook/addon-knobs';
|
||
|
import FeeCard from './fee-card';
|
||
4 years ago
|
|
||
4 years ago
|
const tokenApprovalTextComponent = (
|
||
4 years ago
|
<span key="swaps-view-quote-approve-symbol-1" className="view-quote__bold">
|
||
4 years ago
|
ABC
|
||
|
</span>
|
||
4 years ago
|
);
|
||
4 years ago
|
|
||
4 years ago
|
const containerStyle = {
|
||
|
width: '300px',
|
||
4 years ago
|
};
|
||
4 years ago
|
|
||
|
export default {
|
||
|
title: 'FeeCard',
|
||
4 years ago
|
};
|
||
4 years ago
|
|
||
|
export const WithAllProps = () => {
|
||
|
return (
|
||
|
<div style={containerStyle}>
|
||
|
<FeeCard
|
||
|
feeRowText={text('feeRowText', 'Network fees')}
|
||
4 years ago
|
primaryFee={{
|
||
4 years ago
|
fee: text('primaryFee', '1 ETH'),
|
||
|
maxFee: text('primaryMaxFee', '2 ETH'),
|
||
4 years ago
|
}}
|
||
|
secondaryFee={{
|
||
4 years ago
|
fee: text('secondaryFee', '100 USD'),
|
||
|
maxFee: text('secondaryMaxFee', '200 USD'),
|
||
4 years ago
|
}}
|
||
4 years ago
|
onFeeCardMaxRowClick={action('Clicked max fee row link')}
|
||
|
tokenApprovalTextComponent={tokenApprovalTextComponent}
|
||
|
tokenApprovalSourceTokenSymbol="ABC"
|
||
|
onTokenApprovalClick={action('Clicked third row link')}
|
||
|
hideTokenApprovalRow={false}
|
||
4 years ago
|
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"
|
||
4 years ago
|
/>
|
||
|
</div>
|
||
4 years ago
|
);
|
||
|
};
|
||
4 years ago
|
|
||
|
export const WithoutThirdRow = () => {
|
||
|
return (
|
||
|
<div style={containerStyle}>
|
||
|
<FeeCard
|
||
|
feeRowText={text('feeRowText', 'Network fees')}
|
||
4 years ago
|
primaryFee={{
|
||
4 years ago
|
fee: text('primaryFee', '1 ETH'),
|
||
|
maxFee: text('primaryMaxFee', '2 ETH'),
|
||
4 years ago
|
}}
|
||
|
secondaryFee={{
|
||
4 years ago
|
fee: text('secondaryFee', '100 USD'),
|
||
|
maxFee: text('secondaryMaxFee', '200 USD'),
|
||
4 years ago
|
}}
|
||
4 years ago
|
onFeeCardMaxRowClick={action('Clicked max fee row link')}
|
||
|
hideTokenApprovalRow
|
||
4 years ago
|
onQuotesClick={action('Clicked quotes link')}
|
||
|
numberOfQuotes={number('numberOfQuotes', 1)}
|
||
|
isBestQuote={boolean('isBestQuote', true)}
|
||
|
savings={object('savings 1', { total: '8.55' })}
|
||
|
metaMaskFee="0.875"
|
||
4 years ago
|
/>
|
||
|
</div>
|
||
4 years ago
|
);
|
||
|
};
|
||
4 years ago
|
|
||
|
export const WithOnlyRequiredProps = () => {
|
||
|
return (
|
||
|
<div style={containerStyle}>
|
||
|
<FeeCard
|
||
4 years ago
|
primaryFee={{
|
||
4 years ago
|
fee: text('primaryFee', '1 ETH'),
|
||
|
maxFee: text('primaryMaxFee', '2 ETH'),
|
||
4 years ago
|
}}
|
||
4 years ago
|
onFeeCardMaxRowClick={action('Clicked max fee row link')}
|
||
|
hideTokenApprovalRow
|
||
4 years ago
|
metaMaskFee="0.875"
|
||
|
onQuotesClick={action('Clicked quotes link')}
|
||
|
numberOfQuotes={2}
|
||
4 years ago
|
/>
|
||
|
</div>
|
||
4 years ago
|
);
|
||
|
};
|