Skip to content

Commit

Permalink
Merge pull request #7925 from medelman17/main
Browse files Browse the repository at this point in the history
fix(aws-amplify-react-native): respect user provided theme in react-native withAuthenticator HOC
  • Loading branch information
Michael Edelman authored Mar 11, 2021
2 parents 85d4dcf + 64357b1 commit 5a6cecd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/aws-amplify-react-native/src/Auth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ interface IWithAuthenticatorState {

export function withAuthenticator<Props extends object>(
Comp: React.ComponentType<Props>,
includeGreetings = false,
includeGreetings: boolean | { [index: string]: any } = false,
authenticatorComponents = [],
federated = null,
theme: AmplifyThemeType = null,
Expand All @@ -80,6 +80,9 @@ export function withAuthenticator<Props extends object>(
this.authConfig = {};

if (typeof includeGreetings === 'object' && includeGreetings !== null) {
if (includeGreetings.theme) {
theme = includeGreetings.theme;
}
this.authConfig = Object.assign(this.authConfig, includeGreetings);
} else {
this.authConfig = {
Expand Down

0 comments on commit 5a6cecd

Please sign in to comment.