Skip to content

Commit

Permalink
fix: outline collapsible icons
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoa committed May 20, 2024
1 parent 923483c commit 718f3f9
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/course-home/outline-tab/Section.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { Collapsible, IconButton, Icon } from '@openedx/paragon';
import { faCheckCircle as fasCheckCircle, faMinus, faPlus } from '@fortawesome/free-solid-svg-icons';
import { faCheckCircle as fasCheckCircle } from '@fortawesome/free-solid-svg-icons';
import { faCheckCircle as farCheckCircle } from '@fortawesome/free-regular-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Add, Minus } from '@openedx/paragon/icons';

Check failure on line 8 in src/course-home/outline-tab/Section.jsx

View workflow job for this annotation

GitHub Actions / tests

'/home/runner/work/frontend-app-learning/frontend-app-learning/node_modules/@openedx/paragon/icons/index.js' imported multiple times

import { DisabledVisible } from '@openedx/paragon/icons';

Check failure on line 10 in src/course-home/outline-tab/Section.jsx

View workflow job for this annotation

GitHub Actions / tests

'/home/runner/work/frontend-app-learning/frontend-app-learning/node_modules/@openedx/paragon/icons/index.js' imported multiple times
import SequenceLink from './SequenceLink';
Expand Down Expand Up @@ -40,7 +41,7 @@ const Section = ({

useEffect(() => {
setOpen(defaultOpen);
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const sectionTitle = (
Expand Down Expand Up @@ -71,16 +72,16 @@ const Section = ({
</span>
</div>
{hideFromTOC && (
<div className="row">
{hideFromTOC && (
<span className="small d-flex align-content-end">
<Icon className="mr-2" src={DisabledVisible} data-testid="hide-from-toc-section-icon" />
<span data-testid="hide-from-toc-section-text">
{intl.formatMessage(messages.hiddenSection)}
<div className="row">
{hideFromTOC && (
<span className="small d-flex align-content-end">
<Icon className="mr-2" src={DisabledVisible} data-testid="hide-from-toc-section-icon" />
<span data-testid="hide-from-toc-section-text">
{intl.formatMessage(messages.hiddenSection)}
</span>
</span>
</span>
)}
</div>
)}
</div>
)}
</div>
);
Expand All @@ -96,15 +97,15 @@ const Section = ({
iconWhenClosed={(
<IconButton
alt={intl.formatMessage(messages.openSection)}
icon={faPlus}
iconAs={Add}
onClick={() => { setOpen(true); }}
size="sm"
/>
)}
iconWhenOpen={(
<IconButton
alt={intl.formatMessage(genericMessages.close)}
icon={faMinus}
iconAs={Minus}
onClick={() => { setOpen(false); }}
size="sm"
/>
Expand Down

0 comments on commit 718f3f9

Please sign in to comment.