Невозможно переопределить стандартное усиление с помощью стиля Authenticator с пользовательской темой - PullRequest
0 голосов
/ 18 ноября 2018

Я пытаюсь настроить стиль AWS WithAuthenticator HOC в своем приложении React Native.Я шаг за шагом следовал документации Amplify .Однако приложение продолжает отображать стили по умолчанию (оранжевые кнопки) вместо ожидаемого пользовательского цвета.

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',
  },
});

Может кто-нибудь указать мне, что я делаю неправильно?

...