From 5679aa727ec1a8bf2545a67a41f4115a02f1bad4 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Sat, 1 Aug 2020 08:54:11 -0700 Subject: [PATCH 1/2] fix: add missing Table.Container element --- src/components/table/components/container.js | 30 ++++++++++++++++++++ src/components/table/table.js | 3 ++ 2 files changed, 33 insertions(+) create mode 100644 src/components/table/components/container.js diff --git a/src/components/table/components/container.js b/src/components/table/components/container.js new file mode 100644 index 00000000..d4f0071e --- /dev/null +++ b/src/components/table/components/container.js @@ -0,0 +1,30 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import classnames from 'classnames'; +import modifiers from '../../../modifiers'; +import Element from '../../element'; + +const TableContainer = ({ className, children, position, ...props }) => ( + + {children} + +); + +TableContainer.propTypes = { + ...modifiers.propTypes, + style: PropTypes.shape({}), + className: PropTypes.string, + children: PropTypes.node, +}; + +TableContainer.defaultProps = { + ...modifiers.defaultProps, + style: undefined, + className: undefined, + children: null, +}; + +export default TableContainer; diff --git a/src/components/table/table.js b/src/components/table/table.js index f125322d..3a0b925f 100644 --- a/src/components/table/table.js +++ b/src/components/table/table.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import classnames from 'classnames'; import modifiers from '../../modifiers'; import Element from '../element'; +import Container from './components/container'; const Table = ({ children, className, size, striped, bordered, ...props }) => ( Date: Sun, 2 Aug 2020 09:00:05 -0700 Subject: [PATCH 2/2] Address review feedback --- src/components/table/components/container.js | 1 + src/components/table/table.story.js | 1632 ++++++++++++------ 2 files changed, 1075 insertions(+), 558 deletions(-) diff --git a/src/components/table/components/container.js b/src/components/table/components/container.js index d4f0071e..ff4744cf 100644 --- a/src/components/table/components/container.js +++ b/src/components/table/components/container.js @@ -25,6 +25,7 @@ TableContainer.defaultProps = { style: undefined, className: undefined, children: null, + renderAs: 'div', }; export default TableContainer; diff --git a/src/components/table/table.story.js b/src/components/table/table.story.js index abb0bb7f..87cce62f 100644 --- a/src/components/table/table.story.js +++ b/src/components/table/table.story.js @@ -1,561 +1,1077 @@ import React from 'react'; - import { storiesOf } from '@storybook/react'; import Table from 'react-bulma-components/lib/components/table'; - -storiesOf('Table', module).add('Default', () => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Pos - Team - Pld - - W - - D - - L - - GF - - GA - - GD - - Pts - Qualification or relegation
- Pos - Team - Pld - - W - - D - - L - - GF - - GA - - GD - - Pts - Qualification or relegation
1 - - Leicester City - {' '} - (C) - 38231236836+3281 - Qualification for the{' '} - - Champions League group stage - -
2 - - Arsenal - - 38201176536+2971 - Qualification for the{' '} - - Champions League group stage - -
3 - - Tottenham Hotspur - - 38191366935+3470 - Qualification for the{' '} - - Champions League group stage - -
4 - - Manchester City - - 38199107141+3066 - Qualification for the{' '} - - Champions League play-off round - -
5 - - Manchester United - - 38199104935+1466 - Qualification for the{' '} - - Europa League group stage - -
6 - - Southampton - - 38189115941+1863 - Qualification for the{' '} - - Europa League group stage - -
7 - - West Ham United - - 38161486551+1462 - Qualification for the{' '} - - Europa League third qualifying round - -
8 - - Liverpool - - 381612106350+1360 -
9 - - Stoke City - - 38149154155−1451 -
10 - - Chelsea - - 381214125953+650 -
11 - - Everton - - 381114135955+447 -
12 - - Swansea City - - 381211154252−1047 -
13 - - Watford - - 38129174050−1045 -
14 - - West Bromwich Albion - - 381013153448−1443 -
15 - - Crystal Palace - - 38119183951−1242 -
16 - - AFC Bournemouth - - 38119184567−2242 -
17 - - Sunderland - - 38912174862−1439 -
18 - - Newcastle United - {' '} - (R) - 38910194465−2137 - Relegation to the{' '} - - Football League Championship - -
19 - - Norwich City - {' '} - (R) - 3897223967−2834 - Relegation to the{' '} - - Football League Championship - -
20 - - Aston Villa - {' '} - (R) - 3838272776−4917 - Relegation to the{' '} - - Football League Championship - -
-)); +storiesOf('Table', module).add('Default', () => + ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Pos + Team + Pld + + W + + D + + L + + GF + + GA + + GD + + Pts + Qualification or relegation
+ Pos + Team + Pld + + W + + D + + L + + GF + + GA + + GD + + Pts + Qualification or relegation
1 + + Leicester City + {' '} + (C) + 38231236836+3281 + Qualification for the{' '} + + Champions League group stage + +
2 + + Arsenal + + 38201176536+2971 + Qualification for the{' '} + + Champions League group stage + +
3 + + Tottenham Hotspur + + 38191366935+3470 + Qualification for the{' '} + + Champions League group stage + +
4 + + Manchester City + + 38199107141+3066 + Qualification for the{' '} + + Champions League play-off round + +
5 + + Manchester United + + 38199104935+1466 + Qualification for the{' '} + + Europa League group stage + +
6 + + Southampton + + 38189115941+1863 + Qualification for the{' '} + + Europa League group stage + +
7 + + West Ham United + + 38161486551+1462 + Qualification for the{' '} + + Europa League third qualifying round + +
8 + + Liverpool + + 381612106350+1360 +
9 + + Stoke City + + 38149154155−1451 +
10 + + Chelsea + + 381214125953+650 +
11 + + Everton + + 381114135955+447 +
12 + + Swansea City + + 381211154252−1047 +
13 + + Watford + + 38129174050−1045 +
14 + + West Bromwich Albion + + 381013153448−1443 +
15 + + Crystal Palace + + 38119183951−1242 +
16 + + AFC Bournemouth + + 38119184567−2242 +
17 + + Sunderland + + 38912174862−1439 +
18 + + Newcastle United + {' '} + (R) + 38910194465−2137 + Relegation to the{' '} + + Football League Championship + +
19 + + Norwich City + {' '} + (R) + 3897223967−2834 + Relegation to the{' '} + + Football League Championship + +
20 + + Aston Villa + {' '} + (R) + 3838272776−4917 + Relegation to the{' '} + + Football League Championship + +
+ )).add('with Table.Container', () => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
2468101214161820222426283032343638404244464850525456586062646668707274767880828486889092949698100102104106108110112114116118120122124126128130132134136138140142144146148150152154156158160162164166168170172174176178180182184186188190192194196198200
369121518212427303336394245485154576063666972757881848790939699102105108111114117120123126129132135138141144147150153156159162165168171174177180183186189192195198201204207210213216219222225228231234237240243246249252255258261264267270273276279282285288291294297300
4812162024283236404448525660646872768084889296100104108112116120124128132136140144148152156160164168172176180184188192196200204208212216220224228232236240244248252256260264268272276280284288292296300304308312316320324328332336340344348352356360364368372376380384388392396400
5101520253035404550556065707580859095100105110115120125130135140145150155160165170175180185190195200205210215220225230235240245250255260265270275280285290295300305310315320325330335340345350355360365370375380385390395400405410415420425430435440445450455460465470475480485490495500
+
+ ));