amplify-ui icon indicating copy to clipboard operation
amplify-ui copied to clipboard

Customization issues with ResetPassword (and potentially others)

Open anjanvb opened this issue 3 years ago • 4 comments

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

React

Which UI component?

Authenticator

How is your app built?

Create React App

Please describe your bug.

ResetPassword customization isn't fully working. Customization of the Header() is fine but a custom Footer() shows up along with the original footer. For example, I am trying to render my own Link component in the ResetPassword component but it shows up along with the original Footer. Similar to issue reported here 👉🏽 #1256

Screen Shot 2022-05-27 at 2 35 45 AM

What's the expected behaviour?

The footer should be replaced by the custom component.

Help us reproduce the bug!

Bug can be reproduced in 2.18.2 and 2.18.3. Here's the reproduction with 2.18.2

https://codesandbox.io/s/amplify-customization-issue-forked-4cqxcv

Code Snippet

// Put your code below this line.

const { toSignIn } = useAuthenticator();

const components = {
  Header,
  SignIn: {
    Header() {
      return <LoginHeader />;
    }
  },
  ResetPassword: {
    Header() {
      return <ResetPasswordHeader />;
    },
    Footer() {
      return <button onClick={toSignIn}> Back to sign in </button>;     //--> Custom footer button
    }
  },
  Footer
};

<Authenticator components={components}>
...
</Authenticator>

Additional information and screenshots

Screen Shot 2022-05-27 at 8 15 19 AM

anjanvb avatar May 27 '22 09:05 anjanvb

Hi @anjanvb !

Thanks for the codesandbox!

Yes, this is as expected. Footers don't replace the Back to Sign In link. It's meant to allow you to add more information at the bottom of pages.

To solve this problem in our next major release we are looking to allow you to fully override the resetPassword component. Then you can construct it however you like.

Are you trying to remove the Back to Sign In link ? Perhaps you could remove it using css instead?

ErikCH avatar May 27 '22 16:05 ErikCH

Hey thanks for the response @ErikCH .

Yes, I am trying to override the link with my own custom link mostly for look and feel consistency purposes. Btw, I was able to do this with SignIn where I replace the default "Reset your password" link with my own custom link like this-

SignIn: {
    Header: SignInHeader,
    Footer: SignInFooter
  }
Screen Shot 2022-05-27 at 11 14 25 AM

I guess, the only option would be the css way.

anjanvb avatar May 27 '22 18:05 anjanvb

@ErikCH any ETA for the next major release ?

themrwookiee avatar Jul 21 '22 14:07 themrwookiee

Hi @CptnWookie !

We are still looking at this feature, when we do our next breaking change later this year. The workaround with CSS could work.

ErikCH avatar Aug 09 '22 20:08 ErikCH

Closing in favor of https://github.com/aws-amplify/amplify-ui/issues/2288. @anjanvb Please track this issue there.

reesscot avatar May 04 '23 00:05 reesscot