feat: frontend changes for executive education courses on B2C dashboard
This commit is contained in:
@@ -8,15 +8,20 @@ import { reduxHooks } from 'hooks';
|
||||
import useActionDisabledState from '../hooks';
|
||||
import ActionButton from './ActionButton';
|
||||
import messages from './messages';
|
||||
import { useEnterpriseDashboardData } from '../../../../data/redux/hooks/app';
|
||||
|
||||
export const BeginCourseButton = ({ cardId }) => {
|
||||
const { formatMessage } = useIntl();
|
||||
const { homeUrl } = reduxHooks.useCardCourseRunData(cardId);
|
||||
const { disableBeginCourse } = useActionDisabledState(cardId);
|
||||
|
||||
const { authOrgId } = useEnterpriseDashboardData();
|
||||
const { isExecutiveEd2uCourse } = useActionDisabledState(cardId);
|
||||
const execEdURLParam = `?org_id=${authOrgId}`;
|
||||
const handleClick = reduxHooks.useTrackCourseEvent(
|
||||
track.course.enterCourseClicked,
|
||||
cardId,
|
||||
homeUrl,
|
||||
homeUrl + ((isExecutiveEd2uCourse && authOrgId) ? execEdURLParam : ''),
|
||||
);
|
||||
return (
|
||||
<ActionButton
|
||||
|
||||
Reference in New Issue
Block a user