Skip to content

Commit

Permalink
fix(card): Space props (#145)
Browse files Browse the repository at this point in the history
* fix(card): Space props

- Fixed typings

* chore: Fix types
  • Loading branch information
hachiojidev committed Jan 20, 2021
1 parent 4f7406e commit 8d7fdfa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/components/card.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ it("renders correctly", () => {
expect(asFragment()).toMatchInlineSnapshot(`
<DocumentFragment>
<div
class="sc-bdfBwQ cZfuWT"
class="sc-bdfBwQ gppsKf"
>
<div
class="sc-gsTCUz iMfsSF"
Expand Down
3 changes: 3 additions & 0 deletions src/components/Card/StyledCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import styled, { DefaultTheme } from "styled-components";
import { space } from "styled-system";
import { CardProps } from "./types";

interface StyledCardProps extends CardProps {
Expand Down Expand Up @@ -32,6 +33,8 @@ const StyledCard = styled.div<StyledCardProps>`
color: ${({ theme, isDisabled }) => theme.colors[isDisabled ? "textDisabled" : "text"]};
overflow: hidden;
position: relative;
${space}
`;

StyledCard.defaultProps = {
Expand Down
4 changes: 0 additions & 4 deletions src/components/Card/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import Card from "./Card";

const Row = styled.div`
margin-bottom: 32px;
& > button + button {
margin-left: 16px;
}
`;

export default {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Card/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { HTMLAttributes } from "react";
import { SpaceProps } from "styled-system";
import { Colors } from "../../theme/types";

Expand All @@ -14,7 +15,7 @@ export type CardTheme = {
boxShadowWarning: string;
};

export interface CardProps extends SpaceProps {
export interface CardProps extends SpaceProps, HTMLAttributes<HTMLDivElement> {
isActive?: boolean;
isSuccess?: boolean;
isWarning?: boolean;
Expand Down

0 comments on commit 8d7fdfa

Please sign in to comment.