-
Notifications
You must be signed in to change notification settings - Fork 0
/
Content0.tsx
47 lines (44 loc) · 1.25 KB
/
Content0.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 React from 'react';
import QueueAnim from 'rc-queue-anim';
import { Row, Col } from 'antd';
import OverPack from 'rc-scroll-anim/lib/ScrollOverPack';
import { getChildrenToRender } from './utils';
import { BannerProps } from '../types';
const Content: React.FC<BannerProps> = ({ dataSource, isMobile }: BannerProps) => {
const {
wrapper,
titleWrapper,
page,
OverPack: overPackData,
childWrapper,
} = dataSource;
return (
<div {...wrapper}>
<div {...page}>
<div {...titleWrapper}>
{titleWrapper.children.map(getChildrenToRender)}
</div>
<OverPack {...overPackData}>
<QueueAnim
type="bottom"
key="block"
leaveReverse
componentProps={childWrapper}
>
{childWrapper.children.map((block: any, i: number) => {
const { children: item, ...blockProps } = block;
return (
<Col key={i.toString()} {...blockProps}>
<div {...item}>
{item.children.map(getChildrenToRender)}
</div>
</Col>
);
})}
</QueueAnim>
</OverPack>
</div>
</div>
);
};
export default Content;