Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Cristiano Rastelli <cristiano.rastelli@hashicorp.com>
  • Loading branch information
KristinLBradley and didoo committed May 23, 2024
1 parent 7867b95 commit 74d3466
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
...attributes
>
<Hds::Text::Code class="hds-copy-snippet__text" @tag="span" @size="100">
{{this.textToCopy}}
{{this.textToShow}}
</Hds::Text::Code>
<FlightIcon @name={{this.icon}} class="hds-copy-snippet__icon" />
</button>
12 changes: 5 additions & 7 deletions packages/components/src/components/hds/copy/snippet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ interface HdsCopySnippetSignature {
Args: {
color?: HdsCopySnippetColors;
isFullWidth?: boolean;
textToCopy: HdsClipboardModifierSignature['Args']['Named']['text'];
isTruncated?: boolean;
onError?: HdsClipboardModifierSignature['Args']['Named']['onError'];
onSuccess?: HdsClipboardModifierSignature['Args']['Named']['onSuccess'];
textToCopy: HdsClipboardModifierSignature['Args']['Named']['text'];
onError?: HdsClipboardModifierSignature['Args']['Named']['onError'];
};
Element: HTMLButtonElement;
}
Expand All @@ -39,7 +39,7 @@ export default class HdsCopySnippetComponent extends Component<HdsCopySnippetSig
* @param textToCopy
* @type {string | number | bigint | undefined} ???
*/
get textToCopy() {
get textToShow() {
const { textToCopy = '' } = this.args;

if (typeof textToCopy === 'string') {
Expand Down Expand Up @@ -132,8 +132,7 @@ export default class HdsCopySnippetComponent extends Component<HdsCopySnippetSig
}

@action
// eslint-disable-next-line @typescript-eslint/no-explicit-any
onSuccess(args: any) {
onSuccess(args: HdsClipboardModifierSignature['Args']['Named']['onSuccess']) {
this.status = 'success';
this.resetStatusDelayed();

Expand All @@ -145,8 +144,7 @@ export default class HdsCopySnippetComponent extends Component<HdsCopySnippetSig
}

@action
// eslint-disable-next-line @typescript-eslint/no-explicit-any
onError(args: any) {
onError(args: HdsClipboardModifierSignature['Args']['Named']['onError']) {
this.status = 'error';
this.resetStatusDelayed();

Expand Down

0 comments on commit 74d3466

Please sign in to comment.