Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ES6 default parameters instead of deprecated defaultProps property #1

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 1 addition & 7 deletions build/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ uniconsConfig.forEach(icon => {
const template = `import React from 'react';
import PropTypes from 'prop-types';

const ${name} = (props) => {
const { color, size, ...otherProps } = props
const ${name} = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -48,11 +47,6 @@ ${name}.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

${name}.defaultProps = {
color: 'currentColor',
size: '24',
};

export default ${name};`

fs.writeFileSync(location, template, 'utf-8')
Expand Down
8 changes: 1 addition & 7 deletions icons/uil-0-plus.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const Uil0Plus = (props) => {
const { color, size, ...otherProps } = props
const Uil0Plus = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ Uil0Plus.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

Uil0Plus.defaultProps = {
color: 'currentColor',
size: '24',
};

export default Uil0Plus;
8 changes: 1 addition & 7 deletions icons/uil-10-plus.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const Uil10Plus = (props) => {
const { color, size, ...otherProps } = props
const Uil10Plus = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ Uil10Plus.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

Uil10Plus.defaultProps = {
color: 'currentColor',
size: '24',
};

export default Uil10Plus;
8 changes: 1 addition & 7 deletions icons/uil-12-plus.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const Uil12Plus = (props) => {
const { color, size, ...otherProps } = props
const Uil12Plus = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ Uil12Plus.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

Uil12Plus.defaultProps = {
color: 'currentColor',
size: '24',
};

export default Uil12Plus;
8 changes: 1 addition & 7 deletions icons/uil-13-plus.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const Uil13Plus = (props) => {
const { color, size, ...otherProps } = props
const Uil13Plus = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ Uil13Plus.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

Uil13Plus.defaultProps = {
color: 'currentColor',
size: '24',
};

export default Uil13Plus;
8 changes: 1 addition & 7 deletions icons/uil-16-plus.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const Uil16Plus = (props) => {
const { color, size, ...otherProps } = props
const Uil16Plus = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ Uil16Plus.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

Uil16Plus.defaultProps = {
color: 'currentColor',
size: '24',
};

export default Uil16Plus;
8 changes: 1 addition & 7 deletions icons/uil-17-plus.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const Uil17Plus = (props) => {
const { color, size, ...otherProps } = props
const Uil17Plus = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ Uil17Plus.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

Uil17Plus.defaultProps = {
color: 'currentColor',
size: '24',
};

export default Uil17Plus;
8 changes: 1 addition & 7 deletions icons/uil-18-plus.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const Uil18Plus = (props) => {
const { color, size, ...otherProps } = props
const Uil18Plus = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ Uil18Plus.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

Uil18Plus.defaultProps = {
color: 'currentColor',
size: '24',
};

export default Uil18Plus;
8 changes: 1 addition & 7 deletions icons/uil-21-plus.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const Uil21Plus = (props) => {
const { color, size, ...otherProps } = props
const Uil21Plus = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ Uil21Plus.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

Uil21Plus.defaultProps = {
color: 'currentColor',
size: '24',
};

export default Uil21Plus;
8 changes: 1 addition & 7 deletions icons/uil-3-plus.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const Uil3Plus = (props) => {
const { color, size, ...otherProps } = props
const Uil3Plus = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ Uil3Plus.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

Uil3Plus.defaultProps = {
color: 'currentColor',
size: '24',
};

export default Uil3Plus;
8 changes: 1 addition & 7 deletions icons/uil-500px.js

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

8 changes: 1 addition & 7 deletions icons/uil-6-plus.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const Uil6Plus = (props) => {
const { color, size, ...otherProps } = props
const Uil6Plus = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ Uil6Plus.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

Uil6Plus.defaultProps = {
color: 'currentColor',
size: '24',
};

export default Uil6Plus;
8 changes: 1 addition & 7 deletions icons/uil-abacus.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const UilAbacus = (props) => {
const { color, size, ...otherProps } = props
const UilAbacus = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ UilAbacus.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

UilAbacus.defaultProps = {
color: 'currentColor',
size: '24',
};

export default UilAbacus;
8 changes: 1 addition & 7 deletions icons/uil-accessible-icon-alt.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const UilAccessibleIconAlt = (props) => {
const { color, size, ...otherProps } = props
const UilAccessibleIconAlt = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ UilAccessibleIconAlt.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

UilAccessibleIconAlt.defaultProps = {
color: 'currentColor',
size: '24',
};

export default UilAccessibleIconAlt;
8 changes: 1 addition & 7 deletions icons/uil-adjust-alt.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const UilAdjustAlt = (props) => {
const { color, size, ...otherProps } = props
const UilAdjustAlt = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ UilAdjustAlt.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

UilAdjustAlt.defaultProps = {
color: 'currentColor',
size: '24',
};

export default UilAdjustAlt;
8 changes: 1 addition & 7 deletions icons/uil-adjust-circle.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const UilAdjustCircle = (props) => {
const { color, size, ...otherProps } = props
const UilAdjustCircle = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ UilAdjustCircle.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

UilAdjustCircle.defaultProps = {
color: 'currentColor',
size: '24',
};

export default UilAdjustCircle;
8 changes: 1 addition & 7 deletions icons/uil-adjust-half.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const UilAdjustHalf = (props) => {
const { color, size, ...otherProps } = props
const UilAdjustHalf = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ UilAdjustHalf.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

UilAdjustHalf.defaultProps = {
color: 'currentColor',
size: '24',
};

export default UilAdjustHalf;
8 changes: 1 addition & 7 deletions icons/uil-adjust.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const UilAdjust = (props) => {
const { color, size, ...otherProps } = props
const UilAdjust = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ UilAdjust.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

UilAdjust.defaultProps = {
color: 'currentColor',
size: '24',
};

export default UilAdjust;
8 changes: 1 addition & 7 deletions icons/uil-adobe-alt.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

const UilAdobeAlt = (props) => {
const { color, size, ...otherProps } = props
const UilAdobeAlt = ({ color = 'currentColor', size = '24', ...otherProps }) => {
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
Expand All @@ -20,9 +19,4 @@ UilAdobeAlt.propTypes = {
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};

UilAdobeAlt.defaultProps = {
color: 'currentColor',
size: '24',
};

export default UilAdobeAlt;
Loading