New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add v4 support for tables #3070
Add v4 support for tables #3070
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting there!
src/Table.js
Outdated
[prefix(bsProps, 'striped')]: striped, | ||
[prefix(bsProps, 'bordered')]: bordered, | ||
[prefix(bsProps, 'condensed')]: condensed, | ||
[prefix(bsProps, 'sm')]: sm, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels like a weird choice by the bootstrap team since there is only one size. I'm guessing they were leaving space for other sizes? in which case this might make more sense as a size
prop, like in Button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think similarly with dark
that should become variant='dark'
like Button maybe
src/Table.js
Outdated
if (responsive) { | ||
let responsiveClass = 'responsive'; | ||
if (breakpoint) { | ||
responsiveClass = `${responsiveClass}-${breakpoint}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about making responsive
a prop that can be true
or a breakpoint? like: responsive='sm'
or just responsive
, @taion thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! That would be a better choice in fact.
src/Table.js
Outdated
@@ -10,32 +10,35 @@ import { | |||
} from './utils/bootstrapUtils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just merged some changes to how we do styling, can you take a look a the Button component as an example and use createBootstrap
instead of any utils from bootstrapUtils? thanks!
www/src/pages/components/table.js
Outdated
</h3> | ||
<p> | ||
Across every breakpoint, use <code>responsive</code> for horizontally | ||
scrolling tables. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets maybe add a Callout as well here that responsive tables are wrapping in another div
43f6904
to
55e038d
Compare
55e038d
to
e3c08db
Compare
@jquense I have pushed the suggested changes. Please take a look. Also, apologies for the delay :) |
7d45cd0
to
9fa4dcf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just that one small nit
src/Table.js
Outdated
<table {...elementProps} className={classNames(className, classes)} /> | ||
); | ||
if (responsive) { | ||
let reponsiveClass = 'table-responsive'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be `${bsPrefix}-responsive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good pick!
9fa4dcf
to
07f9321
Compare
.gitignore
Outdated
@@ -2,6 +2,7 @@ | |||
.DS_Store | |||
npm-debug.log* | |||
node_modules | |||
.yarn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is yarn cache. Felt like adding it here since there's going to be a good number of people using Yarn.
src/Table.js
Outdated
<table {...elementProps} className={classNames(className, classes)} /> | ||
); | ||
if (responsive) { | ||
let reponsiveClass = `${bsPrefix}-responsive`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"responsiveClass"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks! :) I have changed and pushed.
07f9321
to
4eb49f4
Compare
4eb49f4
to
c8296cf
Compare
🎉 Thanks a ton! |
* v4-support: (43 commits) quick fix-up on BreadcrumbItem (react-bootstrap#3090) Add v4 support for Jumbotron (react-bootstrap#3064) Breadcrumbs (react-bootstrap#3050) Update logo to svg (react-bootstrap#3088) navbar (react-bootstrap#3082) Forward ref (react-bootstrap#3080) Navs (react-bootstrap#3062) Add v4 support for tables (react-bootstrap#3070) Add v4 support for images and figures (react-bootstrap#3059) Set sideEffects to false for webpack 4 (react-bootstrap#3075) Style context (react-bootstrap#3046) Gatsby v2 (react-bootstrap#3045) fix readme, react-16-enzyme doc running (react-bootstrap#3061) update to babel 7 (react-bootstrap#3044) attribute docs (react-bootstrap#3035) Update dependencies (react-bootstrap#3020) Fix type in README.md Changed ProgressBar check to work with proxied components (react-bootstrap#2965) Improve custom overlays docs (react-bootstrap#2998) Release v0.32.1-docs.0 ...
PR for implementing #3055
table-condensed
totable-sm
.table-inverse
totable-dark
. There was a confusion caused by the migration guide but I guess I will go fix it there too.