diff --git a/src/app/components/Card/Card.stories.tsx b/src/app/components/Card/Card.stories.tsx new file mode 100644 index 0000000..1b7c2e5 --- /dev/null +++ b/src/app/components/Card/Card.stories.tsx @@ -0,0 +1,18 @@ +import * as React from "react"; +import { Card } from "./Card"; + +export default { + component: Card, + title: "Card" +}; + +const card = { + description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the " + + "industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled ", + featureId: "Rohit", + hypothesis: "Lorem Ipsum is simply dummy text of the printing and typesetting industry." +}; + +export const CardView = () => { + return ; +}; diff --git a/src/app/components/Card/Card.tsx b/src/app/components/Card/Card.tsx index cb53977..06c08ba 100644 --- a/src/app/components/Card/Card.tsx +++ b/src/app/components/Card/Card.tsx @@ -1,7 +1,9 @@ import React from "react"; import { style } from "typestyle"; import { Color, Spacing } from "../../constants"; +import { boxShadow } from "../../constants/BoxShadow"; import { Avatar } from "../Avatar/Avatar"; +import { ViewIcon } from "./ViewIcon"; interface IProps { description: string; @@ -10,27 +12,42 @@ interface IProps { } const styles = { body: style({ + color: Color.BLACK, flexGrow: 1, padding: Spacing.L }), container: style({ - border: `1px solid ${Color.GREY}`, - display: "flex", - flexDirection: "column", - height: 250, + $nest: { + "&:hover": { + boxShadow: boxShadow("L") + } + }, + + backgroundColor: Color.WHITE, + boxShadow: boxShadow("XS"), padding: Spacing.NONE, + transition: ".2s", width: 250 }), featureId: style({ - marginLeft: Spacing.S + marginLeft: Spacing.M + }), + features: style({ + alignItems: "center", + display: "flex" }), footer: style({ alignItems: "center", - borderTop: `1px solid ${Color.GREY}`, + boxShadow: boxShadow("XS"), display: "flex", + justifyContent: "space-between", paddingBottom: Spacing.M, - paddingLeft: Spacing.L, - paddingTop: Spacing.M + paddingLeft: Spacing.S, + paddingTop: Spacing.L + }), + viewBtn: style({ + justifySelf: "end", + marginRight: Spacing.M }) }; export const Card: React.FC = (props): JSX.Element => { @@ -42,8 +59,11 @@ export const Card: React.FC = (props): JSX.Element => { {props.hypothesis}
- - {props.featureId} +
+ + {props.featureId} +
+
); diff --git a/src/app/components/Card/ViewIcon.tsx b/src/app/components/Card/ViewIcon.tsx new file mode 100644 index 0000000..1c018a1 --- /dev/null +++ b/src/app/components/Card/ViewIcon.tsx @@ -0,0 +1,20 @@ +import * as React from "react"; + +export const ViewIcon: React.FC = () => { + const style: React.CSSProperties = { + fill: "#000", + fillOpacity: 1, + fillRule: "nonzero", + stroke: "none" + }; + + return( +
+ {/* eslint-disable-next-line @typescript-eslint/tslint/config */} + + + + +
+ ); +}; diff --git a/src/app/constants/BoxShadow.ts b/src/app/constants/BoxShadow.ts new file mode 100644 index 0000000..1a1e98e --- /dev/null +++ b/src/app/constants/BoxShadow.ts @@ -0,0 +1,14 @@ +import { Color } from "./Color"; + +const size = { + L: 8, + M: 6, + S: 4, + XS: 2 +}; + +export type TBoxShadow = "XS" | "S" | "M" | "L"; + +export const boxShadow = (type: TBoxShadow) => { + return `0 0 ${size[type]}px ${Color.GREY}`; +};