Skip to content

Commit

Permalink
chore: use default classNames
Browse files Browse the repository at this point in the history
  • Loading branch information
jjarvisp committed Feb 17, 2025
1 parent af0f874 commit 74109a8
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`SelectMfaTypeComponent renders as expected 1`] = `
data-amplify-form=""
>
<fieldset
class="amplify-flex amplify-authenticator__column"
class="amplify-authenticator__column amplify-flex"
data-amplify-fieldset=""
>
<amplify-slot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
(input)="onInput($event)"
>
<fieldset
class="amplify-flex amplify-authenticator__column"
[class]="classNames(ComponentClassName.Flex, 'amplify-authenticator__column')"
data-amplify-fieldset
[disabled]="authenticator.isPending"
>
<amplify-slot
name="select-mfa-type-header"
[context]="context"
>
<h3 class="amplify-heading amplify-heading--3">{{ headerText }}</h3>
<h3 [class]="classNames(ComponentClassName.Heading, 'amplify-heading--3')">{{ headerText }}</h3>
</amplify-slot>
<amplify-base-form-fields route="selectMfaType"></amplify-base-form-fields>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class SelectMfaTypeComponent implements OnInit {
public headerText: string;
public confirmText = getConfirmText();
public backToSignInText = getBackToSignInText();

public classNames = classNames;
public ComponentClassName = ComponentClassName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`SetupEmailComponent renders as expected 1`] = `
data-amplify-form=""
>
<fieldset
class="amplify-flex amplify-authenticator__column"
class="amplify-authenticator__column amplify-flex"
data-amplify-fieldset=""
>
<amplify-slot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
(input)="onInput($event)"
>
<fieldset
class="amplify-flex amplify-authenticator__column"
[class]="classNames(ComponentClassName.Flex, 'amplify-authenticator__column')"
data-amplify-fieldset
[disabled]="authenticator.isPending"
>
<amplify-slot
name="select-mfa-type-header"
[context]="context"
>
<h3 class="amplify-heading amplify-heading--3">{{ headerText }}</h3>
<h3 [class]="classNames(ComponentClassName.Heading, 'amplify-heading--3')">{{ headerText }}</h3>
</amplify-slot>
<amplify-base-form-fields route="setupEmail"></amplify-base-form-fields>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { TextFieldComponent } from '../../../../primitives/text-field/text-field
import { RadioGroupFieldComponent } from '../../../../primitives/radio-group-field/radio-group-field.component';

const fieldLabel = 'Setup Email';
const fieldInput = { name: 'email', value: 'jjarvisp@amazon.com' };
const fieldInput = { name: 'email', value: 'user@example.com' };

const mockContext: Partial<AuthActorContext> = {
challengeName: 'MFA_SETUP',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Component } from '@angular/core';
import { authenticatorTextUtil, getFormDataFromEvent } from '@aws-amplify/ui';
import {
authenticatorTextUtil,
classNames,
ComponentClassName,
getFormDataFromEvent,
} from '@aws-amplify/ui';

const { getConfirmText, getBackToSignInText, getSetupEmailText } =
authenticatorTextUtil;
Expand All @@ -14,6 +19,9 @@ export class SetupEmailComponent {
public confirmText = getConfirmText();
public backToSignInText = getBackToSignInText();

public classNames = classNames;
public ComponentClassName = ComponentClassName;

constructor(public authenticator: AuthenticatorService) {}

public get context(): AuthenticatorService['slotContext'] {
Expand Down

0 comments on commit 74109a8

Please sign in to comment.