Skip to content

Commit 3814983

Browse files
adi-herwana-nuscysjonathan
authored andcommitted
fix(Note): convert Note component to tsx and standardize padding
- collapse ErrorCard into Note component
1 parent 024c5f3 commit 3814983

File tree

15 files changed

+78
-105
lines changed

15 files changed

+78
-105
lines changed

client/app/bundles/course/assessment/pages/AssessmentMonitoring/PulseGrid.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { WatchGroup } from 'types/channels/liveMonitoring';
44
import { MonitoringRequestData } from 'types/course/assessment/monitoring';
55

66
import BetaChip from 'lib/components/core/BetaChip';
7-
import ErrorCard from 'lib/components/core/ErrorCard';
87
import Page from 'lib/components/core/layouts/Page';
8+
import Note from 'lib/components/core/Note';
99
import useTranslation from 'lib/hooks/useTranslation';
1010

1111
import translations from '../../translations';
@@ -54,8 +54,9 @@ const PulseGrid = (props: PulseGridProps): JSX.Element => {
5454

5555
if (rejected)
5656
return (
57-
<ErrorCard
57+
<Note
5858
message={t(translations.cannotConnectToLiveMonitoringChannel)}
59+
severity="error"
5960
/>
6061
);
6162

client/app/bundles/course/assessment/submission/components/answers/ForumPostResponse/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Typography } from '@mui/material';
44
import PropTypes from 'prop-types';
55

66
import { questionShape } from 'course/assessment/submission/propTypes';
7-
import Error from 'lib/components/core/ErrorCard';
7+
import Error from 'lib/components/core/Note';
88
import FormRichTextField from 'lib/components/form/fields/RichTextField';
99
import toast from 'lib/hooks/toast';
1010

client/app/bundles/course/assessment/submissions/components/tables/SubmissionsTable.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ const SubmissionsTable: FC<Props> = (props) => {
117117

118118
if (submissions.length === 0)
119119
return (
120-
<Page.PaddedSection>
121-
<Note message={intl.formatMessage(translations.noSubmissionsMessage)} />
122-
</Page.PaddedSection>
120+
<Note message={intl.formatMessage(translations.noSubmissionsMessage)} />
123121
);
124122

125123
return (

client/app/bundles/course/discussion/topics/components/lists/TopicList.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ const TopicList: FC<TopicListProps> = (props) => {
4545
}
4646

4747
if (topicList.length === 0) {
48-
return (
49-
<Grid item style={{ position: 'relative', width: '100%' }} xs>
50-
<Note message={t(translations.noTopic)} />
51-
</Grid>
52-
);
48+
return <Note message={t(translations.noTopic)} />;
5349
}
5450

5551
return (

client/app/bundles/course/enrol-requests/pages/UserRequests/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ const UserRequests: FC<Props> = (props) => {
8282
rejectedEnrolRequests.length === 0
8383
) {
8484
return (
85-
<Page.PaddedSection>
86-
<Note message={intl.formatMessage(translations.noEnrolRequests)} />
87-
</Page.PaddedSection>
85+
<Note message={intl.formatMessage(translations.noEnrolRequests)} />
8886
);
8987
}
9088
return undefined;

client/app/bundles/course/forum/pages/ForumTopicShow/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ const ForumTopicShow: FC = () => {
126126
<Box className="my-3 space-y-6">
127127
{topicNote && (
128128
<Note
129-
color={forumTopic.isResolved ? 'success' : undefined}
130129
message={topicNote}
130+
severity={forumTopic.isResolved ? 'success' : 'warning'}
131131
/>
132132
)}
133133
<TopicPostTrees level={0} postIdsArray={forumTopic.postTreeIds} />

client/app/bundles/course/group/pages/GroupShow/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { connect } from 'react-redux';
44
import { useParams } from 'react-router-dom';
55
import PropTypes from 'prop-types';
66

7-
import ErrorCard from 'lib/components/core/ErrorCard';
87
import LoadingIndicator from 'lib/components/core/LoadingIndicator';
98
import Note from 'lib/components/core/Note';
109

@@ -72,8 +71,9 @@ const Category = ({
7271
}
7372
if (hasFetchError) {
7473
return (
75-
<ErrorCard
74+
<Note
7675
message={<FormattedMessage {...translations.fetchFailure} />}
76+
severity="error"
7777
/>
7878
);
7979
}

client/app/bundles/course/user-email-subscriptions/UserEmailSubscriptions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect, useState } from 'react';
22

3-
import ErrorCard from 'lib/components/core/ErrorCard';
43
import LoadingIndicator from 'lib/components/core/LoadingIndicator';
4+
import Note from 'lib/components/core/Note';
55
import { DataHandle } from 'lib/hooks/router/dynamicNest';
66
import { useAppDispatch } from 'lib/hooks/store';
77
import useTranslation from 'lib/hooks/useTranslation';
@@ -39,7 +39,7 @@ const UserEmailSubscriptions = (): JSX.Element => {
3939
if (status === 'loading') return <LoadingIndicator />;
4040

4141
if (status === 'error')
42-
return <ErrorCard message={t(translations.fetchFailure)} />;
42+
return <Note message={t(translations.fetchFailure)} severity="error" />;
4343

4444
return <UserEmailSubscriptionsTable />;
4545
};

client/app/lib/components/core/ErrorCard.jsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

client/app/lib/components/core/Note.jsx

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)