import classNames from 'classnames'; import React from 'react'; import { lightTheme } from '../../../state/ducks/SessionTheme'; import { SessionInput } from '../SessionInput'; import { MAX_USERNAME_LENGTH } from './RegistrationTabs'; const DisplayNameInput = (props: { stealAutoFocus?: boolean; displayName: string; onDisplayNameChanged: (val: string) => any; handlePressEnter: () => any; }) => { return ( // tslint:disable-next-line: use-simple-attributes ); }; const RecoveryPhraseInput = (props: { recoveryPhrase: string; onSeedChanged: (val: string) => any; handlePressEnter: () => any; }) => { return ( ); }; const PasswordAndVerifyPasswordFields = (props: { password: string; passwordFieldsMatch: boolean; passwordErrorString: string; onPasswordChanged: (val: string) => any; onPasswordVerifyChanged: (val: string) => any; handlePressEnter: () => any; }) => { const { password, passwordFieldsMatch, passwordErrorString } = props; const passwordsDoNotMatch = !passwordFieldsMatch && password ? window.i18n('passwordsDoNotMatch') : undefined; return ( <> {!!password && ( )} ); }; export interface Props { // tslint:disable: react-unused-props-and-state showDisplayNameField: boolean; showSeedField: boolean; stealAutoFocus?: boolean; recoveryPhrase?: string; displayName: string; password: string; passwordErrorString: string; passwordFieldsMatch: boolean; handlePressEnter: () => any; onSeedChanged?: (val: string) => any; onDisplayNameChanged: (val: string) => any; onPasswordChanged: (val: string) => any; onPasswordVerifyChanged: (val: string) => any; } export const RegistrationUserDetails = (props: Props) => { if (props.showSeedField && (props.recoveryPhrase === undefined || !props.onSeedChanged)) { throw new Error('if show seed is true, we need callback + value'); } return (
{props.showSeedField && ( )}
{props.showDisplayNameField && ( )}
); };