Skip to content

Commit

Permalink
task/WP-273-CategoryIcon-v6
Browse files Browse the repository at this point in the history
  • Loading branch information
Taylor Grafft committed Oct 18, 2023
1 parent 884fa9e commit e616c08
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
17 changes: 1 addition & 16 deletions client/src/components/_common/AppIcon/AppIcon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,7 @@ import Icon from '_common/Icon';
import './AppIcon.scss';
import iconStyles from '../../../styles/trumps/icon.css';
import iconFontsStyles from '../../../styles/trumps/icon.fonts.css';

const doesClassExist = (className, stylesheets) => {
for (let stylesheet of stylesheets) {
//Required to make this work with Jest/identity-obj-proxy
if (typeof stylesheet === 'object') {
if (stylesheet[className]) {
return true;
}
} else if (typeof stylesheet === 'string') {
if (stylesheet.includes(`.${className}::before`)) {
return true;
}
}
}
return false;
};
import doesClassExist from 'utils/doesClassExist';

const AppIcon = ({ appId, category }) => {
const appIcons = useSelector((state) => state.apps.appIcons);
Expand Down
4 changes: 0 additions & 4 deletions client/src/styles/trumps/icon.fonts.css

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

16 changes: 16 additions & 0 deletions client/src/utils/doesClassExist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function doesClassExist(className, stylesheets) {
for (let stylesheet of stylesheets) {
//Required to make this work with Jest/identity-obj-proxy
if (typeof stylesheet === 'object') {
if (stylesheet[className]) {
return true;
}
} else if (typeof stylesheet === 'string') {
if (stylesheet.includes(`.${className}::before`)) {
return true;
}
}
}
return false;
}
export default doesClassExist;

0 comments on commit e616c08

Please sign in to comment.