diff --git a/examples/wallet/app/components/Listing/ListingColumn.js b/examples/wallet/app/components/Listing/ListingColumn.js new file mode 100644 index 0000000..e0895e4 --- /dev/null +++ b/examples/wallet/app/components/Listing/ListingColumn.js @@ -0,0 +1,14 @@ +// @flow +import React from 'react'; +import type { Node } from 'react'; +import Col from 'react-bootstrap/Col'; + +type Props = { + children: Node +}; + +export default ({ children, ...other }: Props) => ( + + {children} + +); diff --git a/examples/wallet/app/components/ListingRow.js b/examples/wallet/app/components/Listing/ListingRow.js similarity index 58% rename from examples/wallet/app/components/ListingRow.js rename to examples/wallet/app/components/Listing/ListingRow.js index 00531d8..08ee0ad 100644 --- a/examples/wallet/app/components/ListingRow.js +++ b/examples/wallet/app/components/Listing/ListingRow.js @@ -5,13 +5,13 @@ import Row from 'react-bootstrap/Row'; import styles from './ListingRow.scss'; type Props = { - key: string | number, + itemKey: string | number, className?: string, children: Node }; -export default ({ key, className, children }: Props) => ( - +export default ({ itemKey, className, children }: Props) => ( + {children} ); diff --git a/examples/wallet/app/components/ListingRow.scss b/examples/wallet/app/components/Listing/ListingRow.scss similarity index 100% rename from examples/wallet/app/components/ListingRow.scss rename to examples/wallet/app/components/Listing/ListingRow.scss diff --git a/examples/wallet/app/components/Listing/ListingTable.js b/examples/wallet/app/components/Listing/ListingTable.js new file mode 100644 index 0000000..21a3db8 --- /dev/null +++ b/examples/wallet/app/components/Listing/ListingTable.js @@ -0,0 +1,14 @@ +// @flow +import React from 'react'; +import type { Node } from 'react'; +import Container from 'react-bootstrap/Container'; + +type Props = { + children: Node +}; + +export default ({ children, ...other }: Props) => ( + + {children} + +); diff --git a/examples/wallet/app/components/StakePoolList.js b/examples/wallet/app/components/StakePoolList.js index 814d3e1..41a5cf5 100644 --- a/examples/wallet/app/components/StakePoolList.js +++ b/examples/wallet/app/components/StakePoolList.js @@ -1,13 +1,13 @@ // @flow import React from 'react'; import Button from 'react-bootstrap/Button'; -import Col from 'react-bootstrap/Col'; import Row from 'react-bootstrap/Row'; -import Container from 'react-bootstrap/Container'; +import ListingColumn from './Listing/ListingColumn'; +import ListingTable from './Listing/ListingTable'; import type { NewDelegation, PoolId, Delegation } from '../models'; import type { PoolSelectionHandler } from './StakeDelegation'; import { percentageFromParts } from '../utils/proportionsHelper'; -import ListingRow from './ListingRow'; +import ListingRow from './Listing/ListingRow'; import styles from './StakePoolList.scss'; type Props = { @@ -24,7 +24,7 @@ export default ({ newDelegation }: Props) => { return ( - + {stakePools && stakePools.map((poolId: PoolId) => { const activeDelegation = newDelegation[poolId]; @@ -36,15 +36,17 @@ export default ({ const currentDelegationPercentage = currentDelegation && percentageFromParts(currentDelegation, poolId); return ( - - + + {poolId} - - + + {newDelegationPercentage}% - - {currentDelegationPercentage}% - + + + {currentDelegationPercentage}% + +