Skip to content

Commit 962ed97

Browse files
committed
Add support for FontAwesome icons versions 5 and 6
1 parent f682f3e commit 962ed97

12 files changed

+26
-23
lines changed

example/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
},
8282
"dependencies": {
8383
"@fortawesome/fontawesome-svg-core": "^6.1.1",
84-
"@fortawesome/free-solid-svg-icons": "^6.1.1",
84+
"@fortawesome/free-solid-svg-icons": "^5.15.3 || ^6.1.1",
8585
"@fortawesome/react-fontawesome": "^0.1.14",
8686
"classnames": "^2.2.6",
8787
"react-beautiful-dnd": "^13.0.0",

src/formBuilder/Card.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ const useStyles = createUseStyles({
5353
'border-radius': '4px',
5454
},
5555
'& .card-array': {
56-
'& .fa-plus-square': { display: 'none' },
57-
'& .section-entries': { '& .fa-plus-square': { display: 'initial' } },
56+
'& .fa-plus-square, & .fa-square-plus': { display: 'none' },
57+
'& .section-entries': {
58+
'& .fa-plus-square, & .fa-square-plus': { display: 'initial' },
59+
},
5860
},
5961
'& .card-enum': {
6062
display: 'flex',

src/formBuilder/Card.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('Card', () => {
101101
const pencil = wrapper
102102
.find('.card-container')
103103
.first()
104-
.find('.fa-pencil-alt')
104+
.find('.fa-pencil')
105105
.first();
106106
pencil.simulate('click');
107107
expect(wrapper.exists('div[data-test="card-modal"]')).toBeTruthy();

src/formBuilder/CardGallery.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('CardGallery', () => {
4848
document.body.appendChild(div);
4949
const wrapper = mount(<CardGallery {...props} />, { attachTo: div });
5050

51-
const plusButton = wrapper.find('.fa-plus-square').first();
51+
const plusButton = wrapper.find('.fa-square-plus').first();
5252
plusButton.simulate('click');
5353
const createButton = wrapper.find('button').at(1);
5454
expect(mockEvent).toHaveBeenCalledTimes(0);

src/formBuilder/CardModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const useStyles = createUseStyles({
2727
marginBottom: '1em',
2828
height: '32px',
2929
},
30-
'& .fa-question-circle': { color: 'gray' },
30+
'& .fa-question-circle, & .fa-circle-question': { color: 'gray' },
3131
'& .card-modal-boolean': {
3232
'& *': { marginRight: '0.25em', height: 'auto', display: 'inline-block' },
3333
},

src/formBuilder/FormBuilder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ const useStyles = createUseStyles({
2929
'& .fa': {
3030
cursor: 'pointer',
3131
},
32-
'& .fa-question-circle': {
32+
'& .fa-question-circle, & .fa-circle-question': {
3333
color: 'gray',
3434
},
3535
'& .fa-asterisk': {
3636
'font-size': '.9em',
3737
color: 'green',
3838
},
39-
'& .fa-plus-square': {
39+
'& .fa-plus-square, & .fa-square-plus': {
4040
color: 'green',
4141
'font-size': '1.5em',
4242
margin: '0 auto',
@@ -161,7 +161,7 @@ const useStyles = createUseStyles({
161161
formBody: {
162162
display: 'flex',
163163
flexDirection: 'column',
164-
'& .fa-pencil-alt': {
164+
'& .fa-pencil-alt, & .fa-pencil': {
165165
border: '1px solid #1d71ad',
166166
color: '#1d71ad',
167167
},

src/formBuilder/FormBuilder.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ describe('FormBuilder', () => {
155155
const div = document.createElement('div');
156156
document.body.appendChild(div);
157157
const wrapper = mount(<FormBuilder {...props} />, { attachTo: div });
158-
const plusButton = wrapper.find('.fa-plus-square').first();
158+
const plusButton = wrapper.find('.fa-square-plus').first();
159159
plusButton.simulate('click');
160160
const createButton = wrapper.find('button').at(1);
161161
expect(mockEvent).toHaveBeenCalledTimes(0);

src/formBuilder/PredefinedGallery.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const useStyles = createUseStyles({
2222
'& .fa': {
2323
cursor: 'pointer',
2424
},
25-
'& .fa-question-circle': {
25+
'& .fa-question-circle, & .fa-circle-question': {
2626
color: 'gray',
2727
},
2828
'& .fa-asterisk': {
@@ -35,7 +35,7 @@ const useStyles = createUseStyles({
3535
textAlign: 'center',
3636
'& .fa': { cursor: 'pointer', color: '$green', fontSize: '1.5em' },
3737
},
38-
'& .fa-plus-square': {
38+
'& .fa-plus-square & .fa-square-plus': {
3939
color: 'green',
4040
'font-size': '1.5em',
4141
margin: '0 auto',
@@ -100,7 +100,7 @@ const useStyles = createUseStyles({
100100
'& .section-requirements': {
101101
border: '1px dashed black',
102102
},
103-
'& .fa-pencil-alt': {
103+
'& .fa-pencil-alt, & .fa-pencil': {
104104
border: '1px solid #1d71ad',
105105
color: '#1d71ad',
106106
},

0 commit comments

Comments
 (0)