forked from lobehub/lobe-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGridShowcase.tsx
45 lines (39 loc) · 1.25 KB
/
GridShowcase.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
'use client';
import { useTheme } from 'antd-style';
import { rgba } from 'polished';
import { memo } from 'react';
import { Flexbox, FlexboxProps } from 'react-layout-kit';
import GridBackground, { type GridBackgroundProps } from './index';
export interface GridShowcaseProps extends FlexboxProps {
backgroundColor?: GridBackgroundProps['backgroundColor'];
innerProps?: FlexboxProps;
}
const GridShowcase = memo<GridShowcaseProps>(
({ style, children, backgroundColor = '#001dff', innerProps, ...rest }) => {
const theme = useTheme();
return (
<Flexbox style={{ position: 'relative', ...style }} {...rest}>
<GridBackground
animation
colorBack={rgba(theme.colorText, 0.12)}
colorFront={rgba(theme.colorText, 0.6)}
flip
/>
<Flexbox align={'center'} {...innerProps} style={{ zIndex: 4, ...innerProps?.style }}>
{children}
</Flexbox>
<GridBackground
animation
backgroundColor={backgroundColor}
colorBack={rgba(theme.colorText, 0.24)}
colorFront={theme.colorText}
random
reverse
showBackground
style={{ zIndex: 0 }}
/>
</Flexbox>
);
},
);
export default GridShowcase;