|
1 | 1 | import { Flex, Box, chakra, FlexProps, BoxProps } from '@chakra-ui/react';
|
2 | 2 | import { FC, PropsWithChildren } from 'react';
|
3 | 3 |
|
| 4 | +const FlexWrapper = chakra(Flex, { |
| 5 | + baseStyle: { |
| 6 | + backgroundColor: 'dappTemplate.dark.darker', |
| 7 | + padding: 8, |
| 8 | + borderRadius: '2xl', |
| 9 | + textAlign: 'center', |
| 10 | + flex: 1, |
| 11 | + flexDirection: 'column', |
| 12 | + alignItems: 'center', |
| 13 | + justifyContent: 'center', |
| 14 | + }, |
| 15 | +}); |
| 16 | + |
4 | 17 | export const FlexCardWrapper: FC<PropsWithChildren<FlexProps>> = ({
|
5 | 18 | children,
|
6 | 19 | ...props
|
7 | 20 | }) => {
|
8 |
| - const Wrapper = chakra(Flex, { |
9 |
| - baseStyle: { |
10 |
| - backgroundColor: 'dappTemplate.dark.darker', |
11 |
| - padding: 8, |
12 |
| - borderRadius: '2xl', |
13 |
| - textAlign: 'center', |
14 |
| - flex: 1, |
15 |
| - flexDirection: 'column', |
16 |
| - alignItems: 'center', |
17 |
| - justifyContent: 'center', |
18 |
| - ...props, |
19 |
| - }, |
20 |
| - }); |
21 |
| - return <Wrapper>{children}</Wrapper>; |
| 21 | + return <FlexWrapper {...props}>{children}</FlexWrapper>; |
22 | 22 | };
|
23 | 23 |
|
| 24 | +const Wrapper = chakra(Box, { |
| 25 | + baseStyle: { |
| 26 | + backgroundColor: 'dappTemplate.dark.darker', |
| 27 | + padding: 8, |
| 28 | + borderRadius: '2xl', |
| 29 | + }, |
| 30 | +}); |
| 31 | + |
24 | 32 | export const CardWrapper: FC<PropsWithChildren<BoxProps>> = ({
|
25 | 33 | children,
|
26 | 34 | ...props
|
27 | 35 | }) => {
|
28 |
| - const Wrapper = chakra(Box, { |
29 |
| - baseStyle: { |
30 |
| - backgroundColor: 'dappTemplate.dark.darker', |
31 |
| - padding: 8, |
32 |
| - borderRadius: '2xl', |
33 |
| - ...props, |
34 |
| - }, |
35 |
| - }); |
36 |
| - return <Wrapper>{children}</Wrapper>; |
| 36 | + return <Wrapper {...props}>{children}</Wrapper>; |
37 | 37 | };
|
0 commit comments