feat: frontend changes for executive education courses on B2C dashboard

This commit is contained in:
jajjibhai008
2023-08-04 20:02:01 +05:00
parent f1cfe3de68
commit a2c003e542
9 changed files with 49 additions and 5 deletions

View File

@@ -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