diff --git a/src/components/ExpressionSetCard/ExpressionSetCard.stories.tsx b/src/components/ExpressionSetCard/ExpressionSetCard.stories.tsx new file mode 100644 index 0000000..42c7318 --- /dev/null +++ b/src/components/ExpressionSetCard/ExpressionSetCard.stories.tsx @@ -0,0 +1,24 @@ +import "../../styles/globals.css"; +import "../../styles/components.css"; + +import React from "react"; +import { ComponentStory, ComponentMeta } from "@storybook/react"; + +import { ExpressionSetCard } from "./ExpressionSetCard"; + +export default { + title: "Components/Expression Set Card", + component: ExpressionSetCard, +} as ComponentMeta; + +const Template: ComponentStory = (args) => ( + +); + +export const Daily = Template.bind({}); +Daily.args = { + id: 1, + name: "Daily", + description: "Words for daily practice", + word_count: 11, +}; diff --git a/src/components/ExpressionSetCard/ExpressionSetCard.tsx b/src/components/ExpressionSetCard/ExpressionSetCard.tsx new file mode 100644 index 0000000..4269641 --- /dev/null +++ b/src/components/ExpressionSetCard/ExpressionSetCard.tsx @@ -0,0 +1,25 @@ +export interface ExpressionSetCardProps { + id: number; + name: string; + description: string; + word_count: number; +} + +export function ExpressionSetCard({ + id, + name, + description, + word_count, +}: ExpressionSetCardProps) { + return ( +
+

+ {name} + + {word_count} word(s) + +

+

{description}

+
+ ); +} diff --git a/src/components/ExpressionSetCard/index.tsx b/src/components/ExpressionSetCard/index.tsx new file mode 100644 index 0000000..e1f1940 --- /dev/null +++ b/src/components/ExpressionSetCard/index.tsx @@ -0,0 +1 @@ +export * from "./ExpressionSetCard"; diff --git a/src/components/Page/Page.tsx b/src/components/Page/Page.tsx index 33cecea..1eb8c24 100644 --- a/src/components/Page/Page.tsx +++ b/src/components/Page/Page.tsx @@ -1,4 +1,4 @@ -import { PropsWithChildren, ReactNode } from "react"; +import { PropsWithChildren } from "react"; import { Navigation } from "../Navigation"; export interface PageProps {} diff --git a/src/components/Page/index.ts b/src/components/Page/index.ts index e69de29..4bd2ed0 100644 --- a/src/components/Page/index.ts +++ b/src/components/Page/index.ts @@ -0,0 +1 @@ +export * from "./Page"; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 4b45982..81847c4 100755 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,9 +1,8 @@ import type { NextPage } from "next"; -import Head from "next/head"; -import Image from "next/image"; +import { Page } from "../components/Page"; const Home: NextPage = () => { - return
Hello
; + return ; }; export default Home; diff --git a/src/styles/components.css b/src/styles/components.css index cb8a022..452209f 100644 --- a/src/styles/components.css +++ b/src/styles/components.css @@ -1,3 +1,8 @@ +/* This wraps the whole application, rather than just the "page" area */ +#__next { + background-color: darkslategray; +} + /* Page */ .page { @@ -101,3 +106,37 @@ border-radius: 4px; background-color: darkslategray; } + +/* Expression set card */ + +.expression-set-card { + display: flex; + flex-direction: column; + + background-color: lavender; + border: 1px solid darkslategray; + box-shadow: 0px 5px 5px -5px darkslategray; + padding: 16px; + word-wrap: break-word; +} + +.expression-set-card-name { + color: darkslategray; + font-size: 18px; + font-weight: bold; + margin: 10px 0px; +} + +.expression-set-card-word-count { + color: slategray; + font-family: monospace; + font-size: 12px; + margin: 10px; +} + +.expression-set-card-description { + color: darkslategray; + font-size: 15px; + margin: 20px 0px 10px; + overflow-y: auto; +}