Skip to content

Commit

Permalink
fix(animate-begin): deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
danilowoz committed Mar 8, 2024
1 parent 037ef70 commit 37beb7a
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 30 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ const MyLoader = () => (
| **`style?: React.CSSProperties`** <br /> Defaults to `{}` | React DOM only | |
| **`uniqueKey?: string`** <br /> Defaults to random unique id | React DOM only | Use the same value of prop key, <br/>that will solve inconsistency on the SSR, see more [here](https://github.com/danilowoz/react-content-loader/issues/78). |
| **`beforeMask?: JSX.Element`** <br /> Defaults to null | React DOM<br/>React Native | Define custom shapes before content, <br/>see more [here](https://github.com/danilowoz/react-content-loader/issues/266). |
| **`animateBegin?: string`** <br /> Defaults to `undefined` | React DOM only | Delay before the animation begins, identical to the [SVG animate element begin attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/begin)

See all options [live](https://danilowoz.com/react-content-loader/)

Expand Down
20 changes: 0 additions & 20 deletions docs/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -448,23 +448,3 @@ export const BeforeMask = () => {
</>
)
}

/**
* Animation begin delay
*/
export const animateBegin = () => {
return (
<>
<SyntaxCode>{' <ContentLoader animateBegin="5s" />'}</SyntaxCode>
<ContentLoader animateBegin="5s" />
</>
)
}

animateBegin.story = {
parameters: {
notes: `##\`animateBegin?: string\`
Defaults to \`0s\`. This attribute accepts the same values as the SVG animate element's [\`begin\` attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/begin).`,
},
}
1 change: 0 additions & 1 deletion src/web/Svg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { IContentLoaderProps } from './'

const SVG: React.FC<IContentLoaderProps> = ({
animate = true,
animateBegin,
backgroundColor = '#f5f6f7',
backgroundOpacity = 1,
baseUrl = '',
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 @@ -50,7 +50,6 @@ describe('ContentLoader', () => {
uniqueKey="my-id"
width={200}
beforeMask={<rect />}
animateBegin="5s"
>
<rect />
</ContentLoader>
Expand Down Expand Up @@ -152,11 +151,5 @@ describe('ContentLoader', () => {
expect(typeof propsFromFullfield.beforeMask).toBe('object')
expect(propsFromFullfield.beforeMask).toEqual(<rect />)
})

it("`animateBegin` is a string and it's used", () => {
// custom props
expect(typeof propsFromFullfield.animateBegin).toBe('string')
expect(propsFromFullfield.animateBegin).toEqual('5s')
})
})
})
1 change: 0 additions & 1 deletion src/web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import ContentLoader from './ContentLoader'

export interface IContentLoaderProps extends SVGAttributes<SVGElement> {
animate?: boolean
animateBegin?: string
backgroundColor?: string
backgroundOpacity?: number
baseUrl?: string
Expand Down

0 comments on commit 37beb7a

Please sign in to comment.