Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/TinyMCEEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ const TinyMCEEditor = (props) => {
relative_urls: false,
default_link_target: '_blank',
target_list: false,
placeholder: props.placeholder,
images_upload_handler: uploadHandler,
setup,
}}
Expand Down
4 changes: 2 additions & 2 deletions src/components/TopicStats.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const TopicStats = ({
</Tooltip>
)}
>
<div className="d-flex align-items-center mr-3.5">
<div className="d-flex align-items-center mr-3.5" tabIndex={0}>
<Icon src={PostOutline} className="icon-size mr-2" />
{threadCounts?.discussion || 0}
</div>
Expand All @@ -57,7 +57,7 @@ const TopicStats = ({
</Tooltip>
)}
>
<div className="d-flex align-items-center mr-3.5">
<div className="d-flex align-items-center mr-3.5" tabIndex={0}>
<Icon src={HelpOutline} className="icon-size mr-2" />
{threadCounts?.question || 0}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/discussions/discussions-home/DiscussionsHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const DiscussionsHome = () => {
<Suspense fallback={(<Spinner />)}>
<DiscussionContext.Provider value={discussionContextValue}>
{!enableInContextSidebar && (<Header courseOrg={org} courseNumber={courseNumber} courseTitle={courseTitle} />)}
<main className="container-fluid d-flex flex-column p-0 w-100 font-size" id="main" tabIndex="-1">
<main className="container-fluid d-flex flex-column p-0 w-100 font-size" id="main-content" tabIndex="-1">
{!enableInContextSidebar && <CourseTabsNavigation />}
{(isEnrolled || !isUserLearner) && (
<div
Expand Down
27 changes: 19 additions & 8 deletions src/discussions/in-context-topics/topic/Topic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';

import classNames from 'classnames';
import { Link, useParams } from 'react-router-dom';
import { useNavigate, useParams } from 'react-router-dom';

import { useIntl } from '@edx/frontend-platform/i18n';

Expand All @@ -11,13 +11,15 @@ import { Routes } from '../../../data/constants';
import { discussionsPath } from '../../utils';
import messages from '../messages';


const Topic = ({
topic,
showDivider,
index,
}) => {
const intl = useIntl();
const { courseId } = useParams();
const navigate = useNavigate();
const isSelected = (id) => window.location.pathname.includes(id);
const topicUrl = discussionsPath(Routes.TOPICS.TOPIC, {
courseId,
Expand All @@ -26,16 +28,25 @@ const Topic = ({

return (
<>
<Link
className={classNames('discussion-topic p-0 text-decoration-none text-primary-500', {
'border-light-400 border-bottom': showDivider,
})}
<div
className={classNames('discussion-topic p-0 text-decoration-none text-primary-500', { 'border-light-400 border-bottom': showDivider })}
data-topic-id={topic.id}
to={topicUrl()}
onClick={() => isSelected(topic.id)}
onClick={() => {
isSelected(topic.id);
navigate(topicUrl());
}}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
isSelected(topic.id);
navigate(topicUrl());
}
}}
aria-current={isSelected(topic.id) ? 'page' : undefined}
aria-selected={isSelected(topic.id)}
role="option"
tabIndex={(isSelected(topic.id) || index === 0) ? 0 : -1}
style={{ cursor: 'pointer' }}
>
<div className="d-flex flex-row pt-2.5 pb-2 px-4">
<div className="d-flex flex-column flex-fill" style={{ minWidth: 0 }}>
Expand All @@ -47,7 +58,7 @@ const Topic = ({
<TopicStats threadCounts={topic?.threadCounts} />
</div>
</div>
</Link>
</div>
{!showDivider && (
<>
<div className="divider border-top border-light-500" />
Expand Down