-
Notifications
You must be signed in to change notification settings - Fork 166
[Terra-Anchor-Button] Added new sub-component for anchor button #3655
Conversation
packages/terra-core-docs/src/terra-dev-site/doc/button/AnchorButton.doc.mdx
Outdated
Show resolved
Hide resolved
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 left some a11y questions.
it('should render as an anchor when provided an href', () => { | ||
const button = shallow(<Button text="href" href="MockHref" />); | ||
expect(button).toMatchSnapshot(); | ||
it('should render as an anchor when AnchorButton is used', () => { |
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.
Instead of updating Button.test.jsx. New test file similar to icon-button would be easier to add new tests for anchor 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.
Added new test file in 81401ca
## Usage | ||
|
||
```jsx | ||
import AnchorButton from 'terra-button/lib/variants/_AnchorButton'; |
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 update this import statement to
import { AnchorButton } from 'terra-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.
updated in 81401ca
@@ -1,12 +1,13 @@ | |||
import React from 'react'; | |||
import Button from 'terra-button/lib/Button'; | |||
import AnchorButton from 'terra-button/lib/variants/_AnchorButton'; |
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.
same here
import { AnchorButton } from 'terra-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.
updated in 81401ca
can we export anchor button as subcomponent like iconbutton here :
|
@@ -0,0 +1,46 @@ | |||
import { Badge } from 'terra-button/package.json?dev-site-package'; |
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 file name should include numeric value in order to arrange docs in terra-ui site.
AnchorButton.3.doc.mdx
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.
Renamed in 81401ca
[Terra-Anchor-Button] Added new sub-component for anchor button #3655
Summary
New sub component
terra-anchor-button
has been created. Terra-Anchor-button has two required propshref
andtext
.Breaking changes
href
prop has been removed from terra-button. Terra-button will no longer support displaying anchor buttons and requires usage of new sub-component(Terra-Anchor-button).Closes #
Deployment Link
https://terra-core-anchor-butto-n8eh7w.herokuapp.com/home/terra-core/home
Testing
Jest Tests were updated to validate terra-anchor-button for the prop changes.
Additional Details
Thank you for contributing to Terra.
@cerner/terra