Skip to content

Commit fa995e2

Browse files
committed
style: Nits on the code
1 parent f151869 commit fa995e2

File tree

2 files changed

+75
-2
lines changed

2 files changed

+75
-2
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { Helmet } from 'react-helmet';
2+
import { FormattedMessage, useIntl } from 'react-intl';
3+
import { useParams } from 'react-router';
4+
5+
import Header from '@src/header';
6+
import { useCourseDetails } from '@src/course-outline/data/apiHooks';
7+
import SubHeader from '@src/generic/sub-header/SubHeader';
8+
9+
import Loading from '@src/generic/Loading';
10+
import { Stack } from '@openedx/paragon';
11+
import messages from './messages';
12+
import { SummaryCard } from './SummaryCard';
13+
14+
export const ImportDetails = () => {
15+
const intl = useIntl();
16+
17+
const { courseId } = useParams();
18+
const { data, isPending } = useCourseDetails(courseId);
19+
20+
const isSuccess = false;
21+
22+
const renderBody = () => (
23+
isSuccess ? (
24+
<Stack gap={2}>
25+
<h4><FormattedMessage {...messages.importSuccessfulTitle} /></h4>
26+
<p>
27+
<FormattedMessage
28+
{...messages.importSuccessfulBody}
29+
values={{
30+
courseName: data?.title,
31+
}}
32+
/>
33+
</p>
34+
<h4><FormattedMessage {...messages.importSummaryTitle} /></h4>
35+
<SummaryCard />
36+
</Stack>
37+
) : (
38+
<Stack gap={2}>
39+
<h4><FormattedMessage {...messages.importFailedTitle} /></h4>
40+
<p>
41+
<FormattedMessage
42+
{...messages.importFailedBody}
43+
values={{
44+
courseName: data?.title,
45+
}}
46+
/>
47+
</p>
48+
<p>
49+
Reason
50+
</p>
51+
</Stack>
52+
)
53+
);
54+
55+
return (
56+
<>
57+
<Helmet>
58+
<title>
59+
{intl.formatMessage(messages.importDetailsTitle)}
60+
</title>
61+
</Helmet>
62+
<Header isHiddenMainMenu />
63+
<div>
64+
<SubHeader
65+
title={intl.formatMessage(messages.importDetailsTitle)}
66+
/>
67+
{false ? (
68+
<Loading />
69+
) : renderBody()}
70+
</div>
71+
</>
72+
);
73+
};

src/studio-home/tabs-section/courses-tab/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ interface CardListProps {
4444
onClickNewCourse?: () => void;
4545
inSelectMode?: boolean;
4646
selectedCourseId?: string;
47-
migrationStatusWidget?: React.ComponentType<MigrationStatusProps> | null;
47+
migrationStatusWidget?: React.ComponentType<MigrationStatusProps>;
4848
}
4949

5050
const CardList = ({
@@ -152,7 +152,7 @@ interface Props {
152152
isShowProcessing?: boolean;
153153
selectedCourseId?: string;
154154
handleSelect?: (courseId: string) => void;
155-
cardMigrationStatusWidget?: React.ComponentType<MigrationStatusProps> | null;
155+
cardMigrationStatusWidget?: React.ComponentType<MigrationStatusProps>;
156156
}
157157

158158
export const CoursesList: React.FC<Props> = ({

0 commit comments

Comments
 (0)