| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
PatternFly-React preview: https://patternfly-react-pr-3125.surge.sh |
Sorry, something went wrong.
| /** Adds a role to the divider for accessibility */ | ||
| 'role'?: string; | ||
| /** the component type to use */ | ||
| variant?: 'hr' | 'li' | 'div' ; |
There was a problem hiding this comment.
Can you call the prop component to be consistent with other components in the library
Sorry, something went wrong.
There was a problem hiding this comment.
could you explain what you mean here :)
Sorry, something went wrong.
There was a problem hiding this comment.
Our other components name the prop 'component' rather than variant when we want to change the html tag.
Sorry, something went wrong.
There was a problem hiding this comment.
thanks updated
Sorry, something went wrong.
| /** additional classes added to the Badge */ | ||
| className?: string; | ||
| /** Adds a role to the divider for accessibility */ | ||
| 'role'?: string; |
There was a problem hiding this comment.
no need for a role prop. Looks like it should be set to separator for div or li . We should do that conditionally in in the component when the 'component prop is not an hr.
Sorry, something went wrong.
| const Component: any = variant; | ||
|
|
||
| return ( | ||
| <Component {...props} className={css(styles.divider, className)} role={role}/> |
There was a problem hiding this comment.
Can you spread props at the end here so they take precedence.
Sorry, something went wrong.
| <Divider/> | ||
|
|
||
| <ul> | ||
| <li>List item one</li> |
There was a problem hiding this comment.
after you update the component you can update these to remove the role='separator'
Sorry, something went wrong.
| "@patternfly/patternfly@2.33.8": | ||
| version "2.33.8" | ||
| resolved "https://registry.yarnpkg.com/@patternfly/patternfly/-/patternfly-2.33.8.tgz#2885847b4c49d8606abed17a0415da24fec222aa" | ||
| integrity sha512-tkT1GrdIyvGiDvNHATOa7XLMLKdztpra8ngS8qhCcEWBKh9MWNj5ysjOrkna32bSF9GEkR4TFX492W8ESTHWvQ== |
There was a problem hiding this comment.
Can you revert the changes in this file. It should not have been updated with the changes you made.
Sorry, something went wrong.
Codecov Report
@@ Coverage Diff @@
## master #3125 +/- ##
==========================================
+ Coverage 69.02% 69.04% +0.01%
==========================================
Files 858 859 +1
Lines 23535 23549 +14
Branches 1877 1880 +3
==========================================
+ Hits 16246 16259 +13
Misses 6336 6336
- Partials 953 954 +1
Continue to review full report at Codecov.
|
Sorry, something went wrong.
| DividerLi = ( | ||
| <ul> | ||
| <li>List item one</li> | ||
| <Divider variant="li" role="separator"/> |
There was a problem hiding this comment.
you can remove role="seperator"
Sorry, something went wrong.
| import { Divider } from '@patternfly/react-core/dist/esm/experimental'; | ||
|
|
||
| DividerLi = ( | ||
| <Divider variant="div" role="separator"/> |
There was a problem hiding this comment.
you can remove role="seperator"
Sorry, something went wrong.
| /** Adds a role to the divider for accessibility */ | ||
| 'role'?: string; | ||
| /** the component type to use */ | ||
| variant?: 'hr' | 'li' | 'div' ; |
There was a problem hiding this comment.
Our other components name the prop 'component' rather than variant when we want to change the html tag.
Sorry, something went wrong.
| const Component: any = variant; | ||
|
|
||
| return ( | ||
| <Component className={css(styles.divider, className)} role={ variant!='hr' ? 'separator' : undefined } {...props}/> |
There was a problem hiding this comment.
I think you want to do something like this instead.
| <Component className={css(styles.divider, className)} role={ variant!='hr' ? 'separator' : undefined } {...props}/> | |
| <Component className={css(styles.divider, className)} {...(variant != 'hr' && {role : 'seperator' })} {...props}/> |
Sorry, something went wrong.
There was a problem hiding this comment.
That makes sense thank you @tlabaj !
Sorry, something went wrong.
There was a problem hiding this comment.
Looking great Christie. A few more small comments.
Sorry, something went wrong.
| import React from 'react'; | ||
| import { Divider } from '@patternfly/react-core/dist/esm/experimental'; | ||
|
|
||
| DividerHr = ( |
There was a problem hiding this comment.
Did you mean for this to be a function? e.g.
| DividerHr = ( | |
| DividerHr = () => ( |
same comment for other examples.
Sorry, something went wrong.
| } | ||
|
|
||
| export interface DividerProps extends React.HTMLProps<HTMLElement> { | ||
| /** additional classes added to the Badge */ |
There was a problem hiding this comment.
Can you change the prop descriptions to Sentence case.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| const Component: any = component; | ||
|
|
||
| return ( | ||
| <Component className={css(styles.divider, className)} {...(component != 'hr' && {role : 'seperator' })} {...props} /> |
There was a problem hiding this comment.
| <Component className={css(styles.divider, className)} {...(component != 'hr' && {role : 'seperator' })} {...props} /> | |
| <Component className={css(styles.divider, className)} {...(component != 'hr' && {role : 'separator' })} {...props} /> |
Sorry, something went wrong.
| exports[`divider using div 1`] = ` | ||
| <div | ||
| className="pf-c-divider" | ||
| role="seperator" |
There was a problem hiding this comment.
| role="seperator" | |
| role="separator" |
Sorry, something went wrong.
| exports[`divider using li 1`] = ` | ||
| <li | ||
| className="pf-c-divider" | ||
| role="seperator" |
There was a problem hiding this comment.
| role="seperator" | |
| role="separator" |
Sorry, something went wrong.
There was a problem hiding this comment.
😀👍
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
closes #2575