Skip to content

Commit a545d0b

Browse files
authored
fix: responsiveness of MFE discussions (#697)
* fix: fixed sidebar xl screen width * fix: fixed failing test runs * refactor: removed unused css classes
1 parent 8d86e6d commit a545d0b

File tree

12 files changed

+112
-32
lines changed

12 files changed

+112
-32
lines changed

src/discussions/common/ActionsDropdown.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const ActionsDropdown = ({
9999
src={action.icon}
100100
className="icon-size-24"
101101
/>
102-
<span className="font-weight-normal font-xl ml-2">
102+
<span className="font-weight-normal ml-2">
103103
{intl.formatMessage(action.label)}
104104
</span>
105105
</Dropdown.Item>

src/discussions/common/AuthorLabel.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const AuthorLabel = ({
3838

3939
const authorName = useMemo(() => (
4040
<span
41-
className={classNames('mr-1.5 font-size-14 font-style font-weight-500 author-name', {
41+
className={classNames('mr-1.5 font-style font-weight-500 author-name', {
4242
'text-gray-700': isRetiredUser,
4343
'text-primary-500': !authorLabelMessage && !isRetiredUser,
4444
})}
@@ -71,7 +71,7 @@ const AuthorLabel = ({
7171
/>
7272
{authorLabelMessage && (
7373
<span
74-
className={classNames('mr-1.5 font-size-14 font-style font-weight-500', {
74+
className={classNames('mr-1.5 font-style font-weight-500', {
7575
'text-primary-500': showTextPrimary,
7676
'text-gray-700': isRetiredUser,
7777
})}

src/discussions/content-unavailable/ContentUnavailable.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const ContentUnavailable = ({ subTitleMessage }) => {
3535
{intl.formatMessage(messages.contentUnavailableTitle)}
3636
</h3>
3737
<p className="pb-2 text-gray-500 text-center">{intl.formatMessage(subTitleMessage)}</p>
38-
<Button onClick={redirectToDashboard} variant="outline-dark" className="font-size-14 py-2 px-2.5">
38+
<Button onClick={redirectToDashboard} variant="outline-dark" className="py-2 px-2.5">
3939
{intl.formatMessage(messages.contentUnavailableAction)}
4040
</Button>
4141
</div>

src/discussions/discussions-home/DiscussionsHome.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const DiscussionsHome = () => {
8282
<Suspense fallback={(<Spinner />)}>
8383
<DiscussionContext.Provider value={discussionContextValue}>
8484
{!enableInContextSidebar && (<Header courseOrg={org} courseNumber={courseNumber} courseTitle={courseTitle} />)}
85-
<main className="container-fluid d-flex flex-column p-0 w-100" id="main" tabIndex="-1">
85+
<main className="container-fluid d-flex flex-column p-0 w-100 font-size" id="main" tabIndex="-1">
8686
{!enableInContextSidebar && <CourseTabsNavigation />}
8787
{(isEnrolled || !isUserLearner) && (
8888
<div

src/discussions/learners/learner/LearnerCard.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const LearnerCard = ({ learner }) => {
3737
<div className="d-flex flex-column justify-content-start mw-100 flex-fill">
3838
<div className="d-flex align-items-center flex-fill">
3939
<div
40-
className="text-truncate font-weight-500 font-size-14 text-primary-500 font-style"
40+
className="text-truncate font-weight-500 text-primary-500 font-style"
4141
>
4242
{username}
4343
</div>

src/discussions/post-comments/comments/CommentsView.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const CommentsView = ({ threadType }) => {
7373
onClick={handleLoadMoreResponses}
7474
variant="link"
7575
block="true"
76-
className="px-4 mt-3 border-0 line-height-24 py-0 mb-2 font-style font-weight-500 font-size-14"
76+
className="px-4 mt-3 border-0 line-height-24 py-0 mb-2 font-style font-weight-500"
7777
data-testid="load-more-comments"
7878
>
7979
{intl.formatMessage(messages.loadMoreResponses)}
@@ -92,7 +92,7 @@ const CommentsView = ({ threadType }) => {
9292
variant="plain"
9393
block="true"
9494
className="card mb-4 px-0 border-0 py-10px mt-2 font-style font-weight-500
95-
line-height-24 font-size-14 text-primary-500"
95+
line-height-24 text-primary-500"
9696
onClick={handleAddResponse}
9797
data-testid="add-response"
9898
>

src/discussions/post-comments/comments/comment/Comment.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ const Comment = ({
249249
onClick={handleLoadMoreComments}
250250
variant="link"
251251
block="true"
252-
className="font-size-14 line-height-24 font-style pt-10px border-0 font-weight-500 pb-0"
252+
className="line-height-24 font-style pt-10px border-0 font-weight-500 pb-0"
253253
data-testid="load-more-comments-responses"
254254
>
255255
{intl.formatMessage(messages.loadMoreComments)}
@@ -267,7 +267,7 @@ const Comment = ({
267267
) : (
268268
!isClosed && isUserPrivilegedInPostingRestriction && (inlineReplies.length >= 5) && (
269269
<Button
270-
className="d-flex flex-grow mt-2 font-size-14 font-style font-weight-500 text-primary-500 add-comment-btn rounded-0"
270+
className="d-flex flex-grow mt-2 font-style font-weight-500 text-primary-500 add-comment-btn rounded-0"
271271
variant="plain"
272272
style={{ height: '36px' }}
273273
onClick={handleAddCommentReply}

src/discussions/posts/post-editor/PostEditor.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ const PostEditor = ({
241241
resetForm,
242242
}) => (
243243
<Form className="m-4 card p-4 post-form" onSubmit={handleSubmit}>
244-
<h4 className="mb-4 font-style font-size-16" style={{ lineHeight: '16px' }}>
244+
<h4 className="mb-4 font-style" style={{ lineHeight: '16px' }}>
245245
{editExisting
246246
? intl.formatMessage(messages.editPostHeading)
247247
: intl.formatMessage(messages.addPostHeading)}
@@ -423,7 +423,7 @@ const PostEditor = ({
423423
onBlur={handleBlur}
424424
className="mr-4.5"
425425
>
426-
<span className="font-size-14">
426+
<span>
427427
{intl.formatMessage(messages.followPost)}
428428
</span>
429429
</Form.Checkbox>
@@ -436,7 +436,7 @@ const PostEditor = ({
436436
onChange={handleChange}
437437
onBlur={handleBlur}
438438
>
439-
<span className="font-size-14">
439+
<span>
440440
{intl.formatMessage(messages.anonymousToPeersPost)}
441441
</span>
442442
</Form.Checkbox>

src/discussions/posts/post-filter-bar/PostFilterBar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const ActionItem = React.memo(({
4444
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
4545
tabIndex={value === selected ? '0' : '-1'}
4646
>
47-
<Icon src={Check} className={classNames('text-success mr-2', { invisible: value !== selected })} />
47+
<Icon src={Check} className={classNames('text-success dropdown-icon-dimensions', { invisible: value !== selected })} />
4848
<Form.Radio id={id} className="sr-only sr-only-focusable" value={value} tabIndex="0">
4949
{label}
5050
</Form.Radio>

src/discussions/posts/post/Post.jsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,9 @@ const Post = ({ handleAddResponseButton }) => {
206206
)}
207207
>
208208
{(topicContext && !topic) ? (
209-
<>
210-
<span className="w-auto">{topicContext.chapterName}</span>
211-
<span className="mx-1">/</span>
212-
<span className="w-auto">{topicContext.verticalName}</span>
213-
<span className="mx-1">/</span>
214-
<span className="w-auto">{topicContext.unitName}</span>
215-
</>
209+
<span>
210+
{topicContext.chapterName} / {topicContext.verticalName} / {topicContext.unitName}
211+
</span>
216212
) : (
217213
getTopicInfo(topic)
218214
)}

0 commit comments

Comments
 (0)