-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Balances: improved stories && added props description
- Loading branch information
1 parent
8ac8c5f
commit 97744bb
Showing
2 changed files
with
35 additions
and
7 deletions.
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
32 changes: 26 additions & 6 deletions
32
packages/core/src/components/Balances/stories/Balances.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 |
---|---|---|
@@ -1,12 +1,32 @@ | ||
import { showTemplateStory, getDefaultMetadata } from '../../../../../storybook/.storybook/helper' | ||
import Component, { Balances, defaultProps } from '../Balances' | ||
/* eslint-disable react/jsx-props-no-spreading */ | ||
import React, { useState } from 'react' | ||
|
||
import { | ||
showTemplateStory, | ||
getDefaultMetadata, | ||
} from '../../../../../storybook/.storybook/helper' | ||
import { Balances } from '../Balances' | ||
import { data } from './Balances.stories_data' | ||
|
||
export default getDefaultMetadata(Balances, 'Components/Balances') | ||
|
||
const props = { | ||
...defaultProps, | ||
balances: data, | ||
const Component = (props) => { | ||
const [hideSmallBalances, setHideSmallBalances] = useState(true) | ||
|
||
return ( | ||
<Balances | ||
hideSmallBalances={hideSmallBalances} | ||
setHideSmallBalances={setHideSmallBalances} | ||
balances={data} | ||
{...props} | ||
/> | ||
) | ||
} | ||
|
||
export const basic = showTemplateStory(Component, props) | ||
export const basic = showTemplateStory(Component, {}) | ||
|
||
export const withTransferButtons = showTemplateStory(Component, { | ||
showTransfer: true, | ||
handleDepositClick: () => alert('User is going to deposit current wallet'), | ||
handleWithdrawClick: () => alert('User is going to withdraw from current wallet'), | ||
}) |