UNPKG

@open-tender/ui

Version:

A component library for use with the Open Tender web app

15 lines (14 loc) 1.18 kB
import React from 'react'; import { makeProps } from '../utils'; import ModalContent from './ModalContent'; import View from './View'; const SignInPhone = ({ config, handlers, errMsg, modalContentConfig, renderErrorMessage, renderKeypad, renderSignUp }) => { const { signInPhone__title, signInPhone__subtitle } = config; const title = signInPhone__title.props.text || 'Sign In via Phone'; const subtitle = signInPhone__subtitle.props.text || 'Please enter a 10 digit phone number'; return errMsg && renderSignUp ? (React.createElement(ModalContent, { config: modalContentConfig, title: "We couldn't find your account", submit: handlers.retry, submitText: "Re-enter Phone", cancel: handlers.close }, renderSignUp())) : (React.createElement(ModalContent, { config: modalContentConfig, title: title, subtitle: subtitle, submit: handlers.submit, cancel: handlers.close }, React.createElement(View, Object.assign({}, makeProps(config, 'signInPhone__content')), React.createElement(View, Object.assign({}, makeProps(config, 'signInPhone__error')), errMsg && renderErrorMessage(errMsg)), renderKeypad()))); }; export default SignInPhone;