Repository navigation
feat(tools): add helpblock component - #45399
Conversation
|
👀 Review this PR in a CodeSee Review Map |
8a7f256 to
4b80802
Compare
e950252 to
a4037bd
Compare
ahmaxed
left a comment
There was a problem hiding this comment.
Thanks for this PR. it seems like we have been using this component extensively in our code base.
It is interesting that Bootstrap has removed this component in its other versions. Could you please research to see what that is? We might consider doing the same later on.
Here are a few minor considerations.
| export const LightGray = Template.bind({}); | ||
| LightGray.args = { | ||
| className: 'block mt-5 mb-10 text-[color:var(--gray15)]' | ||
| }; | ||
|
|
There was a problem hiding this comment.
| export const LightGray = Template.bind({}); | |
| LightGray.args = { | |
| className: 'block mt-5 mb-10 text-[color:var(--gray15)]' | |
| }; |
There is nothing visible for the help block as story so we should be fine with just keeping the Default Variation.
There was a problem hiding this comment.
Not sure if we need make it wrap another component. Could look up if there are similar storybook instances where a component is not visible?
There was a problem hiding this comment.
For the classes you could use the Alert or Button component as a reference.
|
|
||
| describe('Render the helpblock component', () => { | ||
| it('sould render the helpblock component', () => { | ||
| render(<HelpBlock className='block mt-5 mb-10 text-[#737373]' />); |
There was a problem hiding this comment.
The classes names should be handled within the component by default and we could check if they exist here.
There was a problem hiding this comment.
The color should be set to --quaternary-color. I belive it is called text-default-foreground-quaternary
2e842bc to
cc9f2b9
Compare
cc9f2b9 to
7b67ee1
Compare
|
help-block class was removed from bootstrap 4 and replaced with form-text https://getbootstrap.com/docs/4.0/components/forms/#help-text |
| import './helpblock.css'; | ||
|
|
||
| const classes = [ | ||
| 'block mt-5 mb-10 text-[color:var(--default-foreground-quaternary)]' |
There was a problem hiding this comment.
| 'block mt-5 mb-10 text-[color:var(--default-foreground-quaternary)]' | |
| 'block mt-5 mb-10 text-default-foreground-quaternary' |
| 'block mt-5 mb-10 text-[color:var(--default-foreground-quaternary)]' | ||
| ].join(''); | ||
|
|
||
| export const HelpBlock = (): JSX.Element => { |
There was a problem hiding this comment.
Please use React.forwardRef similar to the image component.
608c230 to
3c7794e
Compare
3c7794e to
9ccfd12
Compare
| @@ -0,0 +1 @@ | |||
| @import '../colors.css'; | |||
There was a problem hiding this comment.
The colors are handled through tailwind, we don't need to import them separately.
There was a problem hiding this comment.
Since the helpBlock does not have styles that cannot be replicated using tailwind classes, having a cdd file is not necessary.
896cc4a to
1ae23fd
Compare
1ae23fd to
a1359a3
Compare
|
I went ahead and made a few changes to finalize the component that I encourage you to take a look at. Here are a few takes:
For the upcoming PRs, I highly recommend using the newly added docs that includes commands to generate a template component. Thank you for working on the HelpBlock component and cannot wait to see this in production. 🙏 🙏 🙏 |
|
Here is a little more clarification.
|

Checklist:
Update index.md)mainbranch of freeCodeCamp.Related to #44668