Skip to content

Commit

Permalink
fix(authenticator): fixing visual inconsistencies (#5389)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanksdesign authored Jul 17, 2024
1 parent 4fed60c commit a024885
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 42 deletions.
11 changes: 11 additions & 0 deletions .changeset/silver-dolls-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@aws-amplify/ui-react": patch
---

fix(authenticator): fixing visual inconsistencies

- Removing any style props from buttons on authenticator to fix font weight inconsistencies
- Moved the in the Authenticator to be in the same location in the DOM in each view
- Made the link buttons consistent across Authenticator views

Fixes #5156
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ export function ConfirmSignUp({
type="submit"
loadingText={getConfirmingText()}
isLoading={isPending}
fontWeight="normal"
>
{getConfirmText()}
</Button>

<Button onClick={resendCode} type="button" fontWeight="normal">
<Button onClick={resendCode} type="button">
{getResendCodeText()}
</Button>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export const FederatedSignInButton = (
<Button
onClick={handleClick}
className="federated-sign-in-button"
fontWeight="normal"
gap="1rem"
>
{iconComponent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`FederatedSignInButton renders as expected with { provider: 'Amazon', te
<div>
<button
class="amplify-button amplify-field-group__control federated-sign-in-button"
style="font-weight: var(--amplify-font-weights-normal); gap: 1rem;"
style="gap: 1rem;"
type="button"
>
<span
Expand All @@ -20,7 +20,7 @@ exports[`FederatedSignInButton renders as expected with { provider: 'Apple', tex
<div>
<button
class="amplify-button amplify-field-group__control federated-sign-in-button"
style="font-weight: var(--amplify-font-weights-normal); gap: 1rem;"
style="gap: 1rem;"
type="button"
>
<span
Expand All @@ -36,7 +36,7 @@ exports[`FederatedSignInButton renders as expected with { provider: 'Facebook',
<div>
<button
class="amplify-button amplify-field-group__control federated-sign-in-button"
style="font-weight: var(--amplify-font-weights-normal); gap: 1rem;"
style="gap: 1rem;"
type="button"
>
<span
Expand All @@ -52,7 +52,7 @@ exports[`FederatedSignInButton renders as expected with { provider: 'Google', te
<div>
<button
class="amplify-button amplify-field-group__control federated-sign-in-button"
style="font-weight: var(--amplify-font-weights-normal); gap: 1rem;"
style="gap: 1rem;"
type="button"
>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ export const ForceNewPassword = ({
variation="primary"
isLoading={isPending}
loadingText={getChangingText()}
fontWeight="normal"
>
{getChangePasswordText()}
</Button>
<Button
onClick={toSignIn}
type="button"
fontWeight="normal"
variation="link"
size="small"
>
Expand Down
10 changes: 2 additions & 8 deletions packages/react/src/components/Authenticator/SignIn/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,16 @@ export function SignIn(): JSX.Element {

<Button
isDisabled={isPending}
isFullWidth
type="submit"
variation="primary"
isLoading={isPending}
loadingText={getSigningInText()}
>
{getSignInText()}
</Button>
<Footer />
</Flex>
</form>
<Footer />
</View>
);
}
Expand All @@ -72,12 +71,7 @@ const DefaultFooter = () => {

return (
<View data-amplify-footer="">
<Button
fontWeight="normal"
onClick={toForgotPassword}
size="small"
variation="link"
>
<Button onClick={toForgotPassword} size="small" variation="link">
{getForgotPasswordText()}
</Button>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ export function SignUp(): JSX.Element {
>
{getCreateAccountText()}
</Button>
<Footer />
</Flex>
</form>

<Footer />
</View>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,13 @@ export const ConfirmSignInFooter = (): JSX.Element => {
isDisabled={isPending}
type="submit"
variation="primary"
fontWeight="normal"
isLoading={isPending}
loadingText={getConfirmingText()}
>
{getConfirmText()}
</Button>

<Button
onClick={toSignIn}
type="button"
variation="link"
fontWeight="normal"
size="small"
>
<Button onClick={toSignIn} type="button" variation="link" size="small">
{getBackToSignInText()}
</Button>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,15 @@ export const TwoButtonSubmitFooter = (

return (
<Flex direction="column">
<Button
fontWeight="normal"
variation="primary"
isDisabled={isPending}
type="submit"
>
<Button variation="primary" isDisabled={isPending} type="submit">
{submitText}
</Button>

<Button
onClick={onClick}
type="button"
variation="link"
fontWeight="normal"
size="small"
>
{cancelButtonText}
</Button>
<Flex direction="column" alignItems="center">
<Button onClick={onClick} type="button" variation="link" size="small">
{cancelButtonText}
</Button>
</Flex>
</Flex>
);
};

0 comments on commit a024885

Please sign in to comment.