Skip to content

Commit

Permalink
EPMRPP-76242 || code review fixes - 4
Browse files Browse the repository at this point in the history
  • Loading branch information
tr1ble committed Apr 4, 2022
1 parent b3e1acd commit 0b76603
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { defineMessages } from 'react-intl';
import { PageBlockContainer } from 'pages/outside/common/pageBlockContainer';
import { connect } from 'react-redux';
import { PureComponent } from 'react';
import React, { PureComponent } from 'react';
import { ExtensionLoader, extensionType } from 'components/extensionLoader';
import { uiExtensionLoginPageSelector } from 'controllers/plugins/uiExtensions';
import PropTypes from 'prop-types';
Expand All @@ -34,8 +34,6 @@ const messages = defineMessages({
},
});

const SIGN_UP_PLUGIN_NAME = 'signup';

@connect(
(state) => ({
extensions: uiExtensionLoginPageSelector(state),
Expand All @@ -50,17 +48,15 @@ export class LoginBlock extends PureComponent {
extensions: [],
};

getSignUpExtension = () => {
render() {
const { extensions } = this.props;

return extensions.find((extension) => extension.pluginName === SIGN_UP_PLUGIN_NAME);
};

render() {
return (
<PageBlockContainer header={messages.welcome} hint={messages.login}>
<LoginForm />
{this.getSignUpExtension() && <ExtensionLoader extension={this.getSignUpExtension()} />}
{extensions.map((extension) => (
<ExtensionLoader extension={extension} />
))}
</PageBlockContainer>
);
}
Expand Down

0 comments on commit 0b76603

Please sign in to comment.