Removes the tightly coupled upgrade/upsell ("notifications") panel from the Learning MFE core and replaces it with a pluggable widget registry system. The right sidebar now supports dynamically-registered external widgets, making it easy to add, remove, or replace sidebar panels without forking the MFE.
28 lines
660 B
JavaScript
28 lines
660 B
JavaScript
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
|
|
const SidebarTriggerBase = ({
|
|
onClick,
|
|
ariaLabel,
|
|
children,
|
|
}) => (
|
|
<button
|
|
className="border border-light-400 bg-transparent align-items-center align-content-center d-flex sidebar-trigger-btn"
|
|
type="button"
|
|
onClick={onClick}
|
|
aria-label={ariaLabel}
|
|
>
|
|
<div className="icon-container d-flex position-relative align-items-center">
|
|
{children}
|
|
</div>
|
|
</button>
|
|
);
|
|
|
|
SidebarTriggerBase.propTypes = {
|
|
onClick: PropTypes.func.isRequired,
|
|
ariaLabel: PropTypes.string.isRequired,
|
|
children: PropTypes.element.isRequired,
|
|
};
|
|
|
|
export default SidebarTriggerBase;
|