Skip to content

Commit

Permalink
fix(interval): deprecated prop
Browse files Browse the repository at this point in the history
  • Loading branch information
danilowoz committed Mar 8, 2024
1 parent 85ef16d commit d4d23f8
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 33 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ const MyLoader = () => (
| **`title?: string`** <br/> Defaults to `Loading...` | React DOM only | It's used to describe what element it is. <br />Use `''` (empty string) to remove. |
| **`baseUrl?: string`**<br /> Defaults to an empty string | React DOM only | Required if you're using `<base url="/" />` document `<head/>`. <br/>This prop is common used as: <br/>`<ContentLoader baseUrl={window.location.pathname} />` which will fill the SVG attribute with the relative path. Related [#93](https://github.com/danilowoz/react-content-loader/issues/93). |
| **`speed?: number`** <br /> Defaults to `1.2` | React DOM<br/>React Native | Animation speed in seconds. |
| **`interval?: number`** <br /> Defaults to `0.25` | React DOM<br/>React Native | Interval of time between runs of the animation, <br/>as a fraction of the animation speed. |
| **`viewBox?: string`** <br /> Defaults to `undefined` | React DOM<br/>React Native | Use viewBox props to set a custom viewBox value, <br/>for more information about how to use it, <br/>read the article [How to Scale SVG](https://css-tricks.com/scale-svg/). |
| **`gradientRatio?: number`** <br /> Defaults to `1.2` | React DOM only | Width of the animated gradient as a fraction of the view box width. |
| **`gradientDirection?: string`** <br /> Defaults to `left-right` | React DOM only | Direction in which the gradient is animated. Useful to implement top-down animations |
| **`rtl?: boolean`** <br /> Defaults to `false` | React DOM<br/>React Native | Content right-to-left. |
| **`backgroundColor?: string`** <br /> Defaults to `#f5f6f7` | React DOM<br/>React Native | Used as background of animation. |
| **`foregroundColor?: string`** <br /> Defaults to `#eee` | React DOM<br/>React Native | Used as the foreground of animation. |
Expand Down
20 changes: 0 additions & 20 deletions docs/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,26 +257,6 @@ speed.story = {
},
}

/**
* Interval
*/
export const interval = () => {
return (
<>
<SyntaxCode>{`<ContentLoader interval={0.8} />`}</SyntaxCode>
<ContentLoader interval={0.8} />
</>
)
}

interval.story = {
parameters: {
notes: `## \`interval?: number\`
Defaults to \`0.25\`. Interval of time between runs of the animation, as a fraction of the animation speed.`,
},
}

/**
* RTL
*/
Expand Down
3 changes: 0 additions & 3 deletions src/web/Svg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const SVG: React.FC<IContentLoaderProps> = ({
gradientRatio = 2,
gradientDirection = 'left-right',
uniqueKey,
interval = 0.25,
rtl = false,
speed = 1.2,
style = {},
Expand All @@ -31,8 +30,6 @@ const SVG: React.FC<IContentLoaderProps> = ({
const rtlStyle = rtl ? { transform: 'scaleX(-1)' } : null
const dur = `${speed}s`

// @deprecated
const keyTimes = `0; ${interval}; 1`

// @deprecated
const gradientTransform =
Expand Down
7 changes: 0 additions & 7 deletions src/web/__tests__/ContentLoader.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ describe('ContentLoader', () => {
gradientRatio={0.5}
gradientDirection="top-bottom"
height={200}
interval={0.5}
preserveAspectRatio="xMaxYMax meet"
rtl
speed={10}
Expand All @@ -66,12 +65,6 @@ describe('ContentLoader', () => {
expect(propsFromFullfield.speed).toBe(10)
})

it("`interval` is a number and it's used", () => {
// custom props
expect(typeof propsFromFullfield.interval).toBe('number')
expect(propsFromFullfield.interval).toBe(0.5)
})

it("`height` is a number and it's used", () => {
// custom props
expect(typeof propsFromFullfield.height).toBe('number')
Expand Down
1 change: 0 additions & 1 deletion src/web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export interface IContentLoaderProps extends SVGAttributes<SVGElement> {
foregroundOpacity?: number
gradientRatio?: number
gradientDirection?: 'left-right' | 'top-bottom'
interval?: number
rtl?: boolean
speed?: number
title?: string
Expand Down

0 comments on commit d4d23f8

Please sign in to comment.