forked from openedx/frontend-app-learner-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExploreProgramsCTA.tsx
More file actions
39 lines (36 loc) · 1.13 KB
/
ExploreProgramsCTA.tsx
File metadata and controls
39 lines (36 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from 'react';
import { getConfig } from '@edx/frontend-platform';
import { useIntl } from '@edx/frontend-platform/i18n';
import { Card, Button } from '@openedx/paragon';
import { Search } from '@openedx/paragon/icons';
import { ExploreProgramsCTAProps } from '../data/types';
import messages from './messages';
const ExploreProgramsCTA: React.FC<ExploreProgramsCTAProps> = ({
hasEnrollments = true,
}) => {
const { formatMessage } = useIntl();
const href = getConfig().EXPLORE_PROGRAMS_URL || `${getConfig().LMS_BASE_URL}/courses`;
return (
<Card>
<Card.Section>
{hasEnrollments ? (
formatMessage(messages.exploreProgramsCTAText)
) : (
<h2 className="text-center">
{formatMessage(messages.hasNoEnrollmentsText)}
</h2>
)}
</Card.Section>
<Card.Footer className="justify-content-center">
<Button
as="a"
href={href}
iconBefore={Search}
>
{formatMessage(messages.exploreProgramsCTAButtonText)}
</Button>
</Card.Footer>
</Card>
);
};
export default ExploreProgramsCTA;