Skip to content

Commit

Permalink
Merge pull request #316 from AmbireTech/fix/icons-default-props
Browse files Browse the repository at this point in the history
fix: superseded defaultProperty on icons
  • Loading branch information
ivopaunov authored Dec 9, 2024
2 parents b0ea1b3 + b66ce33 commit 5778b65
Show file tree
Hide file tree
Showing 63 changed files with 343 additions and 189 deletions.
8 changes: 5 additions & 3 deletions src/resources/icons/Active.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const ActiveIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const ActiveIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
...rest
}) => {
return (
<svg
viewBox="0 0 8.494 9.03"
Expand All @@ -21,6 +25,4 @@ const ActiveIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest
)
}

ActiveIcon.defaultProps = defaultProps

export default ActiveIcon
9 changes: 6 additions & 3 deletions src/resources/icons/AddCart.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const AddCartIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const AddCartIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 24 24"
Expand Down Expand Up @@ -44,6 +49,4 @@ const AddCartIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest
)
}

AddCartIcon.defaultProps = defaultProps

export default AddCartIcon
9 changes: 6 additions & 3 deletions src/resources/icons/AddSigner.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const AddSignerIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const AddSignerIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 21.5 21.5"
Expand Down Expand Up @@ -33,6 +38,4 @@ const AddSignerIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...re
)
}

AddSignerIcon.defaultProps = defaultProps

export default AddSignerIcon
9 changes: 6 additions & 3 deletions src/resources/icons/Analytics.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const AnalyticsIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const AnalyticsIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 21.5 21.5"
Expand Down Expand Up @@ -31,6 +36,4 @@ const AnalyticsIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...re
)
}

AnalyticsIcon.defaultProps = defaultProps

export default AnalyticsIcon
8 changes: 5 additions & 3 deletions src/resources/icons/Archived.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const ArchivedIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const ArchivedIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
...rest
}) => {
return (
<svg viewBox="0 0 9 9" xmlns="http://www.w3.org/2000/svg" width={size} height={size} {...rest}>
<g fill="none" stroke={color} strokeLinecap="round" data-name="archived icon">
Expand All @@ -19,6 +23,4 @@ const ArchivedIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...res
)
}

ArchivedIcon.defaultProps = defaultProps

export default ArchivedIcon
9 changes: 6 additions & 3 deletions src/resources/icons/Attention.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const AttentionIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const AttentionIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 27.051 25.5"
Expand All @@ -23,6 +28,4 @@ const AttentionIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...re
)
}

AttentionIcon.defaultProps = defaultProps

export default AttentionIcon
9 changes: 6 additions & 3 deletions src/resources/icons/Bell.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const BellIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const BellIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 17.565 21.62"
Expand All @@ -27,6 +32,4 @@ const BellIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest })
)
}

BellIcon.defaultProps = defaultProps

export default BellIcon
9 changes: 6 additions & 3 deletions src/resources/icons/Billing.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const BillingIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const BillingIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 26 26"
Expand Down Expand Up @@ -33,6 +38,4 @@ const BillingIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest
)
}

BillingIcon.defaultProps = defaultProps

export default BillingIcon
9 changes: 6 additions & 3 deletions src/resources/icons/BillingDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const BillingDetailsIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const BillingDetailsIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 23.459 25.85"
Expand Down Expand Up @@ -33,6 +38,4 @@ const BillingDetailsIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth,
)
}

BillingDetailsIcon.defaultProps = defaultProps

export default BillingDetailsIcon
4 changes: 1 addition & 3 deletions src/resources/icons/Block.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const ActiveIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const ActiveIcon: React.FC<AppIconProps> = ({ size = defaultProps.size, ...rest }) => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -36,6 +36,4 @@ const ActiveIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest
)
}

ActiveIcon.defaultProps = defaultProps

export default ActiveIcon
8 changes: 5 additions & 3 deletions src/resources/icons/Calendar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const CalendarIcon: React.FC<AppIconProps> = ({ color, size, ...rest }) => {
const CalendarIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
...rest
}) => {
return (
<svg
viewBox="0 0 21.767 24"
Expand Down Expand Up @@ -50,6 +54,4 @@ const CalendarIcon: React.FC<AppIconProps> = ({ color, size, ...rest }) => {
)
}

CalendarIcon.defaultProps = defaultProps

export default CalendarIcon
9 changes: 6 additions & 3 deletions src/resources/icons/Campaign.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const CampaignIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const CampaignIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 36 36"
Expand All @@ -24,6 +29,4 @@ const CampaignIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...res
)
}

CampaignIcon.defaultProps = defaultProps

export default CampaignIcon
9 changes: 6 additions & 3 deletions src/resources/icons/CheckMark.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const CheckMarkIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const CheckMarkIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 21.5 21.5"
Expand All @@ -22,6 +27,4 @@ const CheckMarkIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...re
)
}

CheckMarkIcon.defaultProps = defaultProps

export default CheckMarkIcon
9 changes: 6 additions & 3 deletions src/resources/icons/CheckMarkFilled.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const CheckMarkFilledIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const CheckMarkFilledIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 20 20"
Expand Down Expand Up @@ -29,6 +34,4 @@ const CheckMarkFilledIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth,
)
}

CheckMarkFilledIcon.defaultProps = defaultProps

export default CheckMarkFilledIcon
9 changes: 6 additions & 3 deletions src/resources/icons/Close.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const CloseIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const CloseIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 32 32"
Expand Down Expand Up @@ -37,6 +42,4 @@ const CloseIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }
)
}

CloseIcon.defaultProps = defaultProps

export default CloseIcon
8 changes: 5 additions & 3 deletions src/resources/icons/CompletedIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const CompletedIcon: React.FC<AppIconProps> = ({ color, size, ...rest }) => {
const CompletedIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
...rest
}) => {
return (
<svg
viewBox="0 0 14 14"
Expand All @@ -27,6 +31,4 @@ const CompletedIcon: React.FC<AppIconProps> = ({ color, size, ...rest }) => {
)
}

CompletedIcon.defaultProps = defaultProps

export default CompletedIcon
9 changes: 6 additions & 3 deletions src/resources/icons/Copy.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const CopyIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const CopyIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 25.5 25.5"
Expand Down Expand Up @@ -30,6 +35,4 @@ const CopyIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest })
)
}

CopyIcon.defaultProps = defaultProps

export default CopyIcon
9 changes: 6 additions & 3 deletions src/resources/icons/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const DashboardIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const DashboardIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 26 26"
Expand All @@ -28,6 +33,4 @@ const DashboardIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...re
)
}

DashboardIcon.defaultProps = defaultProps

export default DashboardIcon
9 changes: 6 additions & 3 deletions src/resources/icons/Delete.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import { AppIconProps, defaultProps } from 'types/components/Icon'

const DeleteIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest }) => {
const DeleteIcon: React.FC<AppIconProps> = ({
color = defaultProps.color,
size = defaultProps.size,
strokeWidth = defaultProps.strokeWidth,
...rest
}) => {
return (
<svg
viewBox="0 0 19.64 21.5"
Expand Down Expand Up @@ -36,6 +41,4 @@ const DeleteIcon: React.FC<AppIconProps> = ({ color, size, strokeWidth, ...rest
)
}

DeleteIcon.defaultProps = defaultProps

export default DeleteIcon
Loading

0 comments on commit 5778b65

Please sign in to comment.