Cannot override default Amplify withAuthenticator style with custom theme











up vote
0
down vote

favorite












I am trying to customize the styling of the AWS WithAuthenticator HOC in my React Native application. I followed the Amplify documentation step by step. However, the app keeps rendering the default styling (orange buttons) instead of the expected custom color.



import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Amplify from '@aws-amplify/core';
import config from './aws-exports';
import { withAuthenticator } from 'aws-amplify-react-native';
import { AmplifyTheme } from 'aws-amplify-react-native';

// custom colors for components
const Mybutton = Object.assign({}, AmplifyTheme.button, { backgroundColor: '#000', });
//console.log('My own design: ', Mybutton)
const MyTheme = Object.assign({}, AmplifyTheme, { button: Mybutton });


class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>You are now signed in!</Text>
</View>
);
}
}

export default withAuthenticator(App, { includeGreetings: true }, false, , null, MyTheme)

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});


Can anyone point me to what am I doing wrong?










share|improve this question




























    up vote
    0
    down vote

    favorite












    I am trying to customize the styling of the AWS WithAuthenticator HOC in my React Native application. I followed the Amplify documentation step by step. However, the app keeps rendering the default styling (orange buttons) instead of the expected custom color.



    import React from 'react';
    import { StyleSheet, Text, View } from 'react-native';
    import Amplify from '@aws-amplify/core';
    import config from './aws-exports';
    import { withAuthenticator } from 'aws-amplify-react-native';
    import { AmplifyTheme } from 'aws-amplify-react-native';

    // custom colors for components
    const Mybutton = Object.assign({}, AmplifyTheme.button, { backgroundColor: '#000', });
    //console.log('My own design: ', Mybutton)
    const MyTheme = Object.assign({}, AmplifyTheme, { button: Mybutton });


    class App extends React.Component {
    render() {
    return (
    <View style={styles.container}>
    <Text>You are now signed in!</Text>
    </View>
    );
    }
    }

    export default withAuthenticator(App, { includeGreetings: true }, false, , null, MyTheme)

    const styles = StyleSheet.create({
    container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
    },
    });


    Can anyone point me to what am I doing wrong?










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am trying to customize the styling of the AWS WithAuthenticator HOC in my React Native application. I followed the Amplify documentation step by step. However, the app keeps rendering the default styling (orange buttons) instead of the expected custom color.



      import React from 'react';
      import { StyleSheet, Text, View } from 'react-native';
      import Amplify from '@aws-amplify/core';
      import config from './aws-exports';
      import { withAuthenticator } from 'aws-amplify-react-native';
      import { AmplifyTheme } from 'aws-amplify-react-native';

      // custom colors for components
      const Mybutton = Object.assign({}, AmplifyTheme.button, { backgroundColor: '#000', });
      //console.log('My own design: ', Mybutton)
      const MyTheme = Object.assign({}, AmplifyTheme, { button: Mybutton });


      class App extends React.Component {
      render() {
      return (
      <View style={styles.container}>
      <Text>You are now signed in!</Text>
      </View>
      );
      }
      }

      export default withAuthenticator(App, { includeGreetings: true }, false, , null, MyTheme)

      const styles = StyleSheet.create({
      container: {
      flex: 1,
      backgroundColor: '#fff',
      alignItems: 'center',
      justifyContent: 'center',
      },
      });


      Can anyone point me to what am I doing wrong?










      share|improve this question















      I am trying to customize the styling of the AWS WithAuthenticator HOC in my React Native application. I followed the Amplify documentation step by step. However, the app keeps rendering the default styling (orange buttons) instead of the expected custom color.



      import React from 'react';
      import { StyleSheet, Text, View } from 'react-native';
      import Amplify from '@aws-amplify/core';
      import config from './aws-exports';
      import { withAuthenticator } from 'aws-amplify-react-native';
      import { AmplifyTheme } from 'aws-amplify-react-native';

      // custom colors for components
      const Mybutton = Object.assign({}, AmplifyTheme.button, { backgroundColor: '#000', });
      //console.log('My own design: ', Mybutton)
      const MyTheme = Object.assign({}, AmplifyTheme, { button: Mybutton });


      class App extends React.Component {
      render() {
      return (
      <View style={styles.container}>
      <Text>You are now signed in!</Text>
      </View>
      );
      }
      }

      export default withAuthenticator(App, { includeGreetings: true }, false, , null, MyTheme)

      const styles = StyleSheet.create({
      container: {
      flex: 1,
      backgroundColor: '#fff',
      alignItems: 'center',
      justifyContent: 'center',
      },
      });


      Can anyone point me to what am I doing wrong?







      react-native aws-amplify






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 18 at 14:34

























      asked Nov 18 at 13:38









      Y.Henni

      236




      236





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53361490%2fcannot-override-default-amplify-withauthenticator-style-with-custom-theme%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53361490%2fcannot-override-default-amplify-withauthenticator-style-with-custom-theme%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Paul Cézanne

          UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

          Angular material date-picker (MatDatepicker) auto completes the date on focus out