Files
frontend-app-learning/src/courseware/course/sidebar/common/TriggerBase.jsx
Kshitij Sobti f004d0ab3c feat: Sidebar refactor and add support for discussions sidebar. (#762)
squash!: remove unnecessary styling and migrate to bootstrap and other review feedback
2022-03-07 18:56:05 +05:00

31 lines
742 B
JavaScript

import { injectIntl } from '@edx/frontend-platform/i18n';
import PropTypes from 'prop-types';
import React from 'react';
function SidebarTriggerBase({
onClick,
ariaLabel,
children,
}) {
return (
<button
className="border border-light-400 bg-transparent align-items-center align-content-center d-flex"
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 injectIntl(SidebarTriggerBase);