Skip to content

Commit

Permalink
fix: refactor to use flexbox
Browse files Browse the repository at this point in the history
  • Loading branch information
haideralsh committed Sep 6, 2024
1 parent 46d15af commit fd79f06
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/Card/CardSet.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import React from "react";
import styled from "styled-components";
import { space } from "styled-system";
import { Box } from "../Box";
import { BoxProps } from "../Box/Box";
import Card from "./Card";
import { Flex } from "../Flex";

const UnstyledCardSet = ({ children = [], ...props }: BoxProps) => <Box {...props}>{children}</Box>;

const CardSet = styled(UnstyledCardSet)(space, ({ theme }) => ({
[`${Card}`]: {
marginBottom: theme.space.x1,
"&:last-child": {
marginBottom: theme.space.none,
},
},
}));
const CardSet = styled(Flex)(
({ theme }) => ({
flexDirection: "column",
gap: theme.space.x1,
}),
space
);

export default CardSet;

0 comments on commit fd79f06

Please sign in to comment.