-
Notifications
You must be signed in to change notification settings - Fork 379
feat(hint): added hasNoOffset prop #10488
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
48a71fe
feat(hint): added hasNoOffset prop
evwilkin 4966971
feat(hint): include core bump to alpha 144
evwilkin 2912a0c
rebased
evwilkin b970c15
feat(hint): update prop name and example text
evwilkin 53b7517
feat(hint): update test with new prop name
evwilkin 70e6956
feat(hint): update example copy
evwilkin da31901
feat(hint): added test
evwilkin a7a107f
Merge branch 'feat/10485-hint-offset' of github.com:evwilkin/patternf…
evwilkin 6e42c93
rebase on v6
evwilkin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
packages/react-core/src/components/Hint/__tests__/__snapshots__/Hint.test.tsx.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,23 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`matches hint snapshot 1`] = ` | ||
| exports[`actions are rendered 1`] = ` | ||
| <DocumentFragment> | ||
| <div | ||
| class="pf-v6-c-hint" | ||
| > | ||
| <div | ||
| class="pf-v6-c-hint__actions" | ||
| /> | ||
| > | ||
| test | ||
| </div> | ||
| </div> | ||
| </DocumentFragment> | ||
| `; | ||
|
|
||
| exports[`matches hint snapshot 1`] = ` | ||
| <DocumentFragment> | ||
| <div | ||
| class="pf-v6-c-hint" | ||
| /> | ||
| </DocumentFragment> | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/react-core/src/components/Hint/examples/HintActionsWithNoOffset.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import React from 'react'; | ||
| import { Hint, HintTitle, HintBody, Button, Checkbox } from '@patternfly/react-core'; | ||
|
|
||
| export const HintActionsWithNoOffset: React.FunctionComponent = () => { | ||
| const [hasNoActionsOffset, setHasNoActionsOffset] = React.useState<boolean>(false); | ||
|
|
||
| const toggleOffset = (checked: boolean) => { | ||
| setHasNoActionsOffset(checked); | ||
| }; | ||
|
|
||
| const actions = <Button variant="primary">Action</Button>; | ||
| return ( | ||
| <> | ||
| <Checkbox | ||
| label="actions hasNoOffset" | ||
| isChecked={hasNoActionsOffset} | ||
| onChange={(_event, checked) => toggleOffset(checked)} | ||
| aria-label="remove actions offset" | ||
| id="toggle-actions-offset" | ||
| name="toggle-actions-offset" | ||
| /> | ||
| <div style={{ marginTop: '15px' }}> | ||
| <Hint actions={actions} hasNoActionsOffset={hasNoActionsOffset}> | ||
| <HintTitle>Do more with Find it Fix it capabilities</HintTitle> | ||
| <HintBody> | ||
| Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies. | ||
| </HintBody> | ||
| </Hint> | ||
| </div> | ||
| </> | ||
| ); | ||
| }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
maybe verify here that the no offset style is not applied. Or add a new assertion.
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.
@tlabaj I updated this test, does that work?
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.
Looks good!