Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[Terra-Anchor-Button] Added new sub-component for anchor button #3655

Merged
merged 4 commits into from
Aug 26, 2022

Conversation

sugan2416
Copy link
Collaborator

@sugan2416 sugan2416 commented Aug 23, 2022

Summary

New sub component terra-anchor-button has been created. Terra-Anchor-button has two required props href and text.

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

@sugan2416 sugan2416 requested a review from a team as a code owner August 23, 2022 07:37
@JessieRandle JessieRandle temporarily deployed to terra-core-anchor-butto-n8eh7w August 23, 2022 07:37 Inactive
@JessieRandle JessieRandle temporarily deployed to terra-core-anchor-butto-n8eh7w August 23, 2022 11:06 Inactive
@sugan2416 sugan2416 requested a review from saket2403 August 23, 2022 11:11
Copy link
Contributor

@xenoworf xenoworf left a 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.

@sugan2416 sugan2416 requested a review from xenoworf August 24, 2022 11:49
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', () => {
Copy link
Contributor

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

Copy link
Collaborator Author

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';
Copy link
Contributor

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';

Copy link
Collaborator Author

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';
Copy link
Contributor

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';

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in 81401ca

@supreethmr
Copy link
Contributor

can we export anchor button as subcomponent like iconbutton here :

import IconButton from './variants/_IconButton';

@@ -0,0 +1,46 @@
import { Badge } from 'terra-button/package.json?dev-site-package';
Copy link
Contributor

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed in 81401ca

@JessieRandle JessieRandle temporarily deployed to terra-core-anchor-butto-n8eh7w August 25, 2022 08:25 Inactive
@sugan2416 sugan2416 requested a review from supreethmr August 25, 2022 08:30
@JessieRandle JessieRandle temporarily deployed to terra-core-anchor-butto-n8eh7w August 26, 2022 04:49 Inactive
@sugan2416 sugan2416 merged commit 94f5cf8 into A11y-MVB Aug 26, 2022
@sugan2416 sugan2416 deleted the anchor-button branch August 26, 2022 07:07
sdadn pushed a commit that referenced this pull request Sep 30, 2022
[Terra-Anchor-Button] Added new sub-component for anchor button #3655
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants