import React from 'react'; import { SessionButton, SessionButtonColor, SessionButtonType, } from '../SessionButton'; import { SessionIdEditable } from '../SessionIdEditable'; import { RegistrationUserDetails } from './RegistrationUserDetails'; import { TermsAndConditions } from './TermsAndConditions'; export enum SignUpMode { Default, SessionIDShown, EnterDetails, } export interface Props { // tslint:disable: react-unused-props-and-state signUpMode: SignUpMode; continueSignUp: () => any; createSessionID: () => any; onCompleteSignUpClick: () => any; passwordErrorString: string; passwordFieldsMatch: boolean; displayNameError?: string; displayName: string; password: string; recoveryPhrase: string; stealAutoFocus?: boolean; handlePressEnter: () => any; onSeedChanged: (val: string) => any; onDisplayNameChanged: (val: string) => any; onPasswordChanged: (val: string) => any; onPasswordVerifyChanged: (val: string) => any; } const CreateSessionIdButton = ({ createSessionID, }: { createSessionID: any; }) => { return ( ); }; const ContinueSignUpButton = ({ continueSignUp }: { continueSignUp: any }) => { return ( ); }; export const SignUpTab = (props: Props) => { const { signUpMode, continueSignUp, createSessionID } = props; switch (signUpMode) { case SignUpMode.Default: const allUsersAreRandomly = window.i18n('allUsersAreRandomly...'); return (
{allUsersAreRandomly}
); case SignUpMode.SessionIDShown: return (
{window.i18n('yourUniqueSessionID')}
); // can only be the EnterDetails step default: const { passwordErrorString, passwordFieldsMatch, displayNameError, displayName, password, } = props; let enableCompleteSignUp = true; const displayNameOK = !displayNameError && !!displayName; //display name required const passwordsOK = !password || (!passwordErrorString && passwordFieldsMatch); // password is valid if empty, or if no error and fields are matching enableCompleteSignUp = displayNameOK && passwordsOK; return (
{window.i18n('welcomeToYourSession')}
); } };