Loëck Vézien
7 years ago
committed by
GitHub
15 changed files with 219 additions and 157 deletions
@ -1,10 +0,0 @@ |
|||||
import React from 'react' |
|
||||
|
|
||||
export default props => ( |
|
||||
<svg viewBox="0 0 16 16" {...props}> |
|
||||
<path |
|
||||
fill="currentColor" |
|
||||
d="M7.61970553 0h1.70000005v3.05846154H7.61970553V0zm1.70000005 0v3.05846154H7.61970553V0h1.70000005zM7.81303887 12.9415385h1.70000004V16H7.81303887v-3.0584615zm1.70000004 0V16H7.81303887v-3.0584615h1.70000004zM4.4063722 0h1.70000005v3.05846154H4.4063722V0zm1.70000005 0v3.05846154H4.4063722V0h1.70000005zM4.59970553 12.9415385h1.70000005V16H4.59970553v-3.0584615zm1.70000005 0V16H4.59970553v-3.0584615h1.70000005zM2.6663722 8.81307695V1.94999998h.85000002l6.13827333.00156806c1.80778725.10996034 3.21199965 1.5663186 3.11839335 3.25458581l-.0017039.27851419c.110634 1.74464117-1.2981636 3.21696546-3.16829611 3.32840891H2.6663722zm.85000002 0l.85000003-.85000003v4.31926938l5.60765891.000255c.95057664-.0249932 1.67559124-.7265334 1.65900774-1.5564475l.0002249-.3703244c.0187355-.81415185-.7068616-1.51805139-1.63689158-1.54275245h-6.48zm7.55666668-3.27461541l.0012684-.37872715c.042116-.77004688-.6196246-1.45636138-1.47126841-1.50973437H4.36637225v3.46311513l5.20484808.0002342c.89861507-.06354201 1.55224847-.7529014 1.50181857-1.57488781zM4.36637225 7.11311515l5.18540306.00150901c.00432951-.00026159.15996192-.00067981.46689729-.00125468 1.859875.04881191 3.3551536 1.49937703 3.3143663 3.26201512l-.0001732.3336104c.0359164 1.7788337-1.4578252 3.2242112-3.33649348 3.2733127H2.6663722V7.1130769h.85000002l.85000003.00003825zm0 .00017966v.84978211l-.85000003-.85000002.85000003.00021791z" |
|
||||
/> |
|
||||
</svg> |
|
||||
) |
|
@ -0,0 +1,67 @@ |
|||||
|
// @flow
|
||||
|
|
||||
|
import React, { Fragment } from 'react' |
||||
|
import { storiesOf } from '@storybook/react' |
||||
|
import { listCurrencies } from '@ledgerhq/currencies' |
||||
|
import { getIconByCoinType } from '@ledgerhq/currencies/react' |
||||
|
|
||||
|
import type { Currency } from '@ledgerhq/currencies' |
||||
|
|
||||
|
const stories = storiesOf('currencies', module) |
||||
|
|
||||
|
const currencies: Array<Currency> = listCurrencies() |
||||
|
|
||||
|
stories.add('currencies list', () => ( |
||||
|
<div> |
||||
|
<table border="1"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<td>{'coin type'}</td> |
||||
|
<td>{'name'}</td> |
||||
|
<td>{'color'}</td> |
||||
|
<td>{'icon'}</td> |
||||
|
<td>{'units'}</td> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
{currencies.map(cur => { |
||||
|
const Icon = getIconByCoinType(cur.coinType) |
||||
|
return ( |
||||
|
<tr key={cur.coinType}> |
||||
|
<td>{cur.coinType}</td> |
||||
|
<td>{cur.name}</td> |
||||
|
<td> |
||||
|
{cur.color ? ( |
||||
|
<Fragment> |
||||
|
<div |
||||
|
style={{ |
||||
|
width: 50, |
||||
|
height: 25, |
||||
|
backgroundColor: cur.color, |
||||
|
}} |
||||
|
/> |
||||
|
<div>{cur.color}</div> |
||||
|
</Fragment> |
||||
|
) : ( |
||||
|
'-' |
||||
|
)} |
||||
|
</td> |
||||
|
<td>{Icon ? <Icon size={30} /> : '-'}</td> |
||||
|
<td> |
||||
|
{cur.units && ( |
||||
|
<ul style={{ paddingRight: 10 }}> |
||||
|
{cur.units.map(unit => ( |
||||
|
<li key={unit.code}> |
||||
|
{unit.code} ({unit.magnitude}) |
||||
|
</li> |
||||
|
))} |
||||
|
</ul> |
||||
|
)} |
||||
|
</td> |
||||
|
</tr> |
||||
|
) |
||||
|
})} |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
)) |
Loading…
Reference in new issue