Skip to content

Commit 73948ab

Browse files
committed
fix: style on ImportedCourseCard
1 parent ab24e7c commit 73948ab

File tree

3 files changed

+52
-26
lines changed

3 files changed

+52
-26
lines changed

src/library-authoring/import-course/ImportedCourseCard.tsx

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
import { FormattedMessage } from '@edx/frontend-platform/i18n';
2-
import { Button, Card, Icon } from '@openedx/paragon';
1+
import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n';
32
import {
3+
Button,
4+
Card,
5+
Icon,
6+
} from '@openedx/paragon';
7+
import {
8+
ArrowForwardIos,
49
Check,
510
Error,
611
Folder,
@@ -48,34 +53,46 @@ const StateIcon = ({ state }: { state: CourseImport['state'] }) => (
4853
);
4954

5055
export const ImportedCourseCard = ({ courseImport }: ImportedCourseCardProps) => {
56+
const intl = useIntl();
5157
const { navigateTo } = useLibraryRoutes();
5258

5359
return (
5460
<Card className={BORDER_CLASS[courseImport.state]}>
55-
<Card.Section>
56-
<Link to={`/course/${courseImport.source.key}`}>
57-
<h4>{courseImport.source.displayName}</h4>
58-
</Link>
59-
<div className="d-inline-flex small align-items-center">
60-
<StateIcon state={courseImport.state} />
61-
{courseImport.state === 'Failed' ? (
62-
<FormattedMessage {...messages.courseImportTextFailed} />
63-
) : (
64-
<>
65-
{Math.round(courseImport.progress * 100)}
66-
<FormattedMessage {...messages.courseImportTextProgress} />
67-
</>
68-
)}
69-
{courseImport.targetCollection && (
70-
<Button
71-
iconBefore={Folder}
72-
variant="link"
73-
className="ml-4"
74-
onClick={() => navigateTo({ collectionId: courseImport.targetCollection!.key })}
75-
>
76-
{courseImport.targetCollection.title}
77-
</Button>
78-
)}
61+
<Card.Section className="d-flex flex-row">
62+
<div>
63+
<Link to={`/course/${courseImport.source.key}`}>
64+
<h4>{courseImport.source.displayName}</h4>
65+
</Link>
66+
<div className="d-inline-flex small align-items-center">
67+
<StateIcon state={courseImport.state} />
68+
{courseImport.state === 'Failed' ? (
69+
<FormattedMessage {...messages.courseImportTextFailed} />
70+
) : (
71+
<>
72+
{Math.round(courseImport.progress * 100)}
73+
<FormattedMessage {...messages.courseImportTextProgress} />
74+
</>
75+
)}
76+
{courseImport.targetCollection && (
77+
<Button
78+
iconBefore={Folder}
79+
variant="link"
80+
className="ml-4 text-black text-decoration-underline"
81+
onClick={() => navigateTo({ collectionId: courseImport.targetCollection!.key })}
82+
>
83+
{courseImport.targetCollection.title}
84+
</Button>
85+
)}
86+
</div>
87+
</div>
88+
<div className="d-flex align-items-center ml-auto">
89+
<Link
90+
to={`/course/${courseImport.source.key}`}
91+
aria-label={intl.formatMessage(messages.courseImportNavigateAlt)}
92+
className="text-primary-500"
93+
>
94+
<Icon src={ArrowForwardIos} />
95+
</Link>
7996
</div>
8097
</Card.Section>
8198
</Card>

src/library-authoring/import-course/index.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@
1313
.status-border-in-progress {
1414
border-left: 8px solid #F4B57B;
1515
}
16+
17+
.text-decoration-underline {
18+
text-decoration: underline;
19+
}

src/library-authoring/import-course/messages.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ const messages = defineMessages({
3636
defaultMessage: 'Import Failed',
3737
description: 'Text for the course import failed state',
3838
},
39+
courseImportNavigateAlt: {
40+
id: 'course-authoring.library-authoring.import-course.course.navigate-alt',
41+
defaultMessage: 'Navigate to course',
42+
description: 'Alt text for the course import navigate button',
43+
},
3944
helpAndSupportTitle: {
4045
id: 'course-authoring.library-authoring.import-course.help-and-support.title',
4146
defaultMessage: 'Help & Support',

0 commit comments

Comments
 (0)