This change adds a plugin slot for the login page allowing it to be customised. Since there was a dependency conflict between frontend-plugin-framework and the react-hooks testing package, the react-hooks testing package has been removed and a replaced with a simple mechanism for testing hooks. Since this touched the Login Page those have also been refactored to move away from redux connect.
32 lines
744 B
JavaScript
32 lines
744 B
JavaScript
import React from 'react';
|
|
|
|
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import LoginPage from '../../login/LoginPage';
|
|
|
|
const LoginComponentSlot = ({
|
|
institutionLogin,
|
|
handleInstitutionLogin,
|
|
}) => (
|
|
<PluginSlot
|
|
id="org.openedx.frontend.authn.login_component.v1"
|
|
pluginProps={{
|
|
isInstitutionLogin: institutionLogin,
|
|
setInstitutionLogin: handleInstitutionLogin,
|
|
}}
|
|
>
|
|
<LoginPage
|
|
institutionLogin={institutionLogin}
|
|
handleInstitutionLogin={handleInstitutionLogin}
|
|
/>
|
|
</PluginSlot>
|
|
);
|
|
|
|
LoginComponentSlot.propTypes = {
|
|
institutionLogin: PropTypes.bool,
|
|
handleInstitutionLogin: PropTypes.func,
|
|
};
|
|
|
|
export default LoginComponentSlot;
|