Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aws-amplify-react-native): respect user provided theme in react-native withAuthenticator HOC #7925

Merged
merged 1 commit into from
Mar 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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