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

Link Broken #2787

Closed
GabrielSuttner opened this issue Dec 21, 2020 · 1 comment · Fixed by #3101
Closed

Link Broken #2787

GabrielSuttner opened this issue Dec 21, 2020 · 1 comment · Fixed by #3101
Labels
amplify/js Issues tied to JS

Comments

@GabrielSuttner
Copy link

GabrielSuttner commented Dec 21, 2020

Page: /ui/q/framework/react-native

Feedback:

The link under Customization > Theming > "For React Native, you must override properties defined in AmplifyTheme.js here" is broken.
I think it is supposed to go here: https://github.com/aws-amplify/amplify-js/blob/main/packages/aws-amplify-react/src/Amplify-UI/Amplify-UI-Theme.tsx

Also related to this post, custom themes aren't overwriting the default ones. I'm trying to simply change the default SIGN IN button color to blue instead of orange:


import 'react-native-gesture-handler';
import * as React from 'react';

import {DrawerNavigator} from './navigation';

import {createStore, combineReducers, applyMiddleware} from 'redux';
import ReduxThunk from 'redux-thunk';
import {Provider, useDispatch, useSelector} from 'react-redux';
import {NavigationContainer} from '@react-navigation/native';

import {withAuthenticator, AmplifyTheme} from 'aws-amplify-react-native';
import Amplify from 'aws-amplify';

const myButton = Object.assign({}, AmplifyTheme.button, {
  backgroundColor: 'blue',
});
const MyTheme = Object.assign({}, AmplifyTheme, {
  button: myButton,
});

import reducers from './store/reducers';

import {COGNITO_CONFIG} from './constants';

Amplify.configure(COGNITO_CONFIG);

const rootReducer = combineReducers({
  user: reducers,
});

const store = createStore(rootReducer, applyMiddleware(ReduxThunk));

const app = () => {
  return (
    <Provider store={store}>
      <NavigationContainer>
        <DrawerNavigator />
      </NavigationContainer>
    </Provider>
  );
};

export default withAuthenticator(app, {
  includeGreetings: true,
  usernameAttributes: 'email',

  theme: {MyTheme},
  signUpConfig: {header: 'Welcome to Celeste, Please sign up'},
});

I'm using .button because that's the only one that would seem to work according to https://github.com/aws-amplify/amplify-js/blob/main/packages/aws-amplify-react-native/src/AmplifyTheme.ts. All other configuration stuff for the Authenticator work besides custom themes for me.

@mauerbac mauerbac added the amplify/js Issues tied to JS label Dec 24, 2020
@medelman17 medelman17 added this to the Issue Burndown milestone Mar 11, 2021
@medelman17
Copy link

Theming-related issues were fixed here: aws-amplify/amplify-js#7925

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amplify/js Issues tied to JS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants