-
Notifications
You must be signed in to change notification settings - Fork 0
/
Content11.tsx
47 lines (42 loc) · 1.25 KB
/
Content11.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { useEffect, useState } from 'react';
import OverPack from 'rc-scroll-anim/lib/ScrollOverPack';
import QueueAnim from 'rc-queue-anim';
import TweenOne from 'rc-tween-one';
import { Button } from 'antd';
import { getChildrenToRender } from './utils';
import { BannerProps } from '../types';
const Content11: React.FC<BannerProps> = ({ dataSource, ...props }) => {
const [dataSource1, setDataSource] = useState(dataSource);
useEffect(() => {
setDataSource(dataSource);
}, [dataSource]);
return (
<OverPack {...props} {...dataSource1.OverPack}>
<QueueAnim
type="bottom"
leaveReverse
key="page"
delay={[0, 100]}
{...dataSource1.titleWrapper}
>
{dataSource1.titleWrapper.children.map(getChildrenToRender)}
</QueueAnim>
<TweenOne
key="button"
style={{ textAlign: 'center' }}
{...dataSource1.button}
animation={
[
{ x: 0, y: "+=30", duration: 200, type: 'from', opacity: 0 },
{ x: 0, y: 0, opacity: 1 },
]
}
>
<Button {...dataSource1.button.children.a}>
{dataSource1.button.children.a.children}
</Button>
</TweenOne>
</OverPack>
);
};
export default Content11;