Skip to content

Commit

Permalink
chore: replace font-awesome with paragon icons (#350)
Browse files Browse the repository at this point in the history
* chore: replace font-awesome with paragon icons

* fix: refactor to incorporate reviewer comment
  • Loading branch information
katrinan029 authored Aug 9, 2023
1 parent 5241cc1 commit ce95b39
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 74 deletions.
56 changes: 0 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions packages/catalog-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
"@edx/frontend-build": "12.7.0",
"@edx/frontend-platform": "4.6.0",
"@edx/paragon": "20.45.0",
"@fortawesome/free-solid-svg-icons": "5.8.1",
"@fortawesome/react-fontawesome": "0.2.0",
"@testing-library/jest-dom": "5.11.6",
"@testing-library/react": "12.1.4",
"@testing-library/react-hooks": "3.4.2",
Expand All @@ -62,8 +60,6 @@
"peerDependencies": {
"@edx/frontend-platform": "^4.0.1",
"@edx/paragon": "^19.15.0 || ^20.0.0",
"@fortawesome/free-solid-svg-icons": "^5.8.1",
"@fortawesome/react-fontawesome": "^0.1.4",
"react": "^16.12.0 || ^17.0.0",
"react-dom": "^16.12.0 || ^17.0.0",
"react-instantsearch-dom": "^6.8.3",
Expand Down
7 changes: 3 additions & 4 deletions packages/catalog-search/src/CurrentRefinements.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';

import { Badge, Button } from '@edx/paragon';
import { CloseSmall } from '@edx/paragon/icons';
import { connectCurrentRefinements } from 'react-instantsearch-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faTimes } from '@fortawesome/free-solid-svg-icons';

import ClearCurrentRefinements from './ClearCurrentRefinements';

Expand Down Expand Up @@ -86,15 +85,15 @@ export const CurrentRefinementsBase = ({ items, variant }) => {
>
{/* Temporary fix : can be removed when learnerpathway content type is changed to pathways */}
<span className="mr-2">{item.label === LEARNING_TYPE_PATHWAY ? 'Pathway' : item.label}</span>
<FontAwesomeIcon icon={faTimes} />
<CloseSmall />
<span className="sr-only">Remove the filter {item.label}</span>
</Badge>
</li>
))}
{!showAllRefinements && activeRefinementsAsFlatArray.length > NUM_CURRENT_REFINEMENTS_TO_DISPLAY && (
<li className="mr-2">
<Badge
className={classNames('fe__refinement-badge mb-2 py-2 font-weight-light', { 'fe__refinement-badge--default': variant === STYLE_VARIANTS.defualt })}
className={classNames('fe__refinement-badge mb-2 py-2 font-weight-light fe_current-icon-justify-center', { 'fe__refinement-badge--default': variant === STYLE_VARIANTS.defualt })}
variant="light"
onClick={() => setShowAllRefinements(true)}
>
Expand Down
8 changes: 3 additions & 5 deletions packages/catalog-search/src/MobileFilterMenu.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faTimes, faCaretDown } from '@fortawesome/free-solid-svg-icons';
import { connectCurrentRefinements } from 'react-instantsearch-dom';
import { Button } from '@edx/paragon';
import { ArrowDropDown, Close } from '@edx/paragon/icons';

import ClearCurrentRefinements from './ClearCurrentRefinements';

Expand All @@ -30,7 +29,7 @@ export const MobileFilterMenuBase = ({ children, className, items }) => {
</span>
)}
</div>
<FontAwesomeIcon icon={faCaretDown} />
<ArrowDropDown />
</Button>
)}
<div
Expand Down Expand Up @@ -58,8 +57,7 @@ export const MobileFilterMenuBase = ({ children, className, items }) => {
className="btn-close position-absolute px-2"
onClick={() => setIsOpen(false)}
>
<FontAwesomeIcon
icon={faTimes}
<Close
id="icon-close-mobile-filter-menu"
/>
<span className="sr-only">close filter menu</span>
Expand Down
9 changes: 4 additions & 5 deletions packages/catalog-search/src/SearchPagination.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { useContext, useMemo } from 'react';
import PropTypes from 'prop-types';
import { connectPagination } from 'react-instantsearch-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faAngleLeft, faAngleRight } from '@fortawesome/free-solid-svg-icons';
import { Pagination } from '@edx/paragon';
import { Pagination, Icon } from '@edx/paragon';
import { ArrowBackIos, ArrowForwardIos } from '@edx/paragon/icons';

import { SearchContext } from './SearchContext';
import { setRefinementAction, deleteRefinementAction } from './data/actions';
Expand All @@ -19,13 +18,13 @@ export const SearchPaginationBase = ({
() => ({
left: (
<>
<FontAwesomeIcon icon={faAngleLeft} />
<Icon src={ArrowBackIos} />
<div className="sr-only">Navigate Left</div>
</>
),
right: (
<>
<FontAwesomeIcon icon={faAngleRight} />
<Icon src={ArrowForwardIos} />
<div className="sr-only">Navigate Right</div>
</>
),
Expand Down
6 changes: 6 additions & 0 deletions packages/catalog-search/src/styles/_CurrentRefinements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@
.fe__current-refinement-button--inverse {
color: $white;
}

.fe_current-icon-justify-center {
height: 40px;
display: flex;
align-items: center;
}

0 comments on commit ce95b39

Please sign in to comment.