cancel
Showing results for 
Search instead for 
Did you mean: 

PWA: how do intercept in JSX construction with switch

PWA: how do intercept in JSX construction with switch

I had code from accounMenu.js

 

switch (view) {
        case 'ACCOUNT': {
            dropdownContents = <AccountMenuItems onSignOut={handleSignOut} />;

            break;
        }
        case 'FORGOT_PASSWORD': {
            dropdownContents = (
                <ForgotPassword
                    initialValues={{ email: username }}
                    onCancel={handleCancel}
                />
            );

            break;
        }
        case 'CREATE_ACCOUNT': {
            dropdownContents = (
                <CreateAccount
                    classes={{ root: classes.createAccount }}
                    initialValues={{ email: username }}
                    isCancelButtonHidden={false}
                    onSubmit={handleAccountCreation}
                    onCancel={handleCancel}
                />
            );

            break;
        }
        case 'SIGNIN':
        default: {
            dropdownContents = (
                <SignIn
                    classes={{
                        modal_active: classes.loading
                    }}
                    setDefaultUsername={updateUsername}
                    showCreateAccount={handleCreateAccount}
                    showForgotPassword={handleForgotPassword}
                />
            );

            break;
        }
    }

and i want insert my extension (local-intercept.js) after CreateAccount for example, how i can do it?

 

AuthDetails.insertAfterJSX(
        "<div ref={ref} className={contentsClass}>{accountMenuIsOpen ? dropdownContents : null} </div>",
        `<Auth />`
    );