Amazon web services 反应本地客户注册

Amazon web services 反应本地客户注册,amazon-web-services,react-native,amazon-cognito,aws-amplify,Amazon Web Services,React Native,Amazon Cognito,Aws Amplify,我一直在尝试编辑amplify's withAuthenticator的默认UI主题,主题正常工作,但现在它似乎已将我的注册页面重置为默认页面 例如,请参见此处的“我的代码”: const signUpConfig = { header: 'Sign up to our App', hideAllDefaults: true, signUpFields: [ { label: 'Username', key: 'username', req

我一直在尝试编辑amplify's withAuthenticator的默认UI主题,主题正常工作,但现在它似乎已将我的注册页面重置为默认页面

例如,请参见此处的“我的代码”:

const signUpConfig = {
  header: 'Sign up to our App',
  hideAllDefaults: true,
  signUpFields: [
    {
      label: 'Username',
      key: 'username',
      required: true,
      displayOrder: 1,
      type: 'string'
    },
    {
      label: 'Password',
      key: 'password',
      required: true,
      displayOrder: 2,
      type: 'password'
    },
    {
      label: 'Email',
      key: 'email',
      required: true,
      displayOrder: 4,
      type: 'string'
    }
  ]
};
const usernameAttributes = 'Username';

const MyButton = Object.assign({}, AmplifyTheme.button, { backgroundColor: 'yellow' });
const sectionLink = Object.assign({}, AmplifyTheme.sectionFooterLink, { color: 'black' });
const buttondisable = Object.assign({}, AmplifyTheme.buttonDisabled, { backgroundColor: '#cccccc' });
const MyTheme = Object.assign({}, AmplifyTheme, { button: MyButton }, {sectionFooterLink:sectionLink},{buttonDisabled:buttondisable});

export default withAuthenticator(RealApp,false, [], null, MyTheme, {signUpConfig}
);
有什么想法吗?我已经阅读了文档,甚至还以不同的方式格式化了导出默认值,但要么是注册页面被覆盖,要么是主题没有应用等等。

让它工作起来了

事实证明,您必须将整个配置添加到导出中,例如

export default withAuthenticator(RealApp,false, [], null, MyTheme, {header: 'Sign up to our App',
hideAllDefaults: true,
signUpFields: [
  {
    label: 'Username',
    key: 'username',
    required: true,
    displayOrder: 1,
    type: 'string'
  },
  {
    label: 'Password',
    key: 'password',
    required: true,
    displayOrder: 2,
    type: 'password'
  },
  {
    label: 'Email',
    key: 'email',
    required: true,
    displayOrder: 4,
    type: 'string'
  }
]
}
);