Skip to content

Commit 5fdc88d

Browse files
committed
chakra factory bugfix
1 parent 3d725d0 commit 5fdc88d

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### [2.2.1](https://github.com/ElrondDevGuild/nextjs-dapp-template/releases/tag/v2.2.1) (2022-10-10)
2+
- bugfix for the wrong usage of the Chakra Factory on CardWrapper and FlexCardWrapper components. Thanks to @janniksam for reporting that
3+
14
### [2.2.0](https://github.com/ElrondDevGuild/nextjs-dapp-template/releases/tag/v2.2.0) (2022-10-09)
25
- dependencies updates (Next, erdjs, etc.)
36

components/ui/CardWrapper.tsx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
import { Flex, Box, chakra, FlexProps, BoxProps } from '@chakra-ui/react';
22
import { FC, PropsWithChildren } from 'react';
33

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+
417
export const FlexCardWrapper: FC<PropsWithChildren<FlexProps>> = ({
518
children,
619
...props
720
}) => {
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>;
2222
};
2323

24+
const Wrapper = chakra(Box, {
25+
baseStyle: {
26+
backgroundColor: 'dappTemplate.dark.darker',
27+
padding: 8,
28+
borderRadius: '2xl',
29+
},
30+
});
31+
2432
export const CardWrapper: FC<PropsWithChildren<BoxProps>> = ({
2533
children,
2634
...props
2735
}) => {
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>;
3737
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nextjs-dapp-template",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"author": "Julian Ćwirko <julian.io>",
55
"license": "MIT",
66
"homepage": "https://github.com/ElrondDevGuild/nextjs-dapp-template",

0 commit comments

Comments
 (0)