Skip to content

Commit

Permalink
fix: Hide unit tags sidebar if taxonomies disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuf-musleh committed May 8, 2024
1 parent e82c2de commit 5d37761
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/course-unit/CourseUnit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import PublishControls from './sidebar/PublishControls';
import LocationInfo from './sidebar/LocationInfo';
import TagsSidebarControls from '../content-tags-drawer/tags-sidebar-controls';
import { PasteNotificationAlert } from './clipboard';
import { useTaggingFeaturesEnabled } from '../generic/data/apiHooks';

const CourseUnit = ({ courseId }) => {
const { blockId } = useParams();
Expand Down Expand Up @@ -65,6 +66,8 @@ const CourseUnit = ({ courseId }) => {
const initialXBlocksData = useMemo(() => courseVerticalChildren.children ?? [], [courseVerticalChildren.children]);
const [unitXBlocks, setUnitXBlocks] = useState(initialXBlocksData);

const taxonomiesEnabled = useTaggingFeaturesEnabled();

useEffect(() => {
document.title = getPageHeadTitle('', unitTitle);
}, [unitTitle]);
Expand Down Expand Up @@ -200,9 +203,12 @@ const CourseUnit = ({ courseId }) => {
<Sidebar data-testid="course-unit-sidebar">
<PublishControls blockId={blockId} />
</Sidebar>
<Sidebar className="tags-sidebar">
<TagsSidebarControls />
</Sidebar>
{
taxonomiesEnabled &&

Check failure on line 207 in src/course-unit/CourseUnit.jsx

View workflow job for this annotation

GitHub Actions / tests

'&&' should be placed at the beginning of the line
<Sidebar className="tags-sidebar">

Check failure on line 208 in src/course-unit/CourseUnit.jsx

View workflow job for this annotation

GitHub Actions / tests

Missing parentheses around multilines JSX
<TagsSidebarControls />
</Sidebar>
}
<Sidebar data-testid="course-unit-location-sidebar">
<LocationInfo />
</Sidebar>
Expand Down

0 comments on commit 5d37761

Please sign in to comment.