-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
101 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from "react"; | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import storyDialog from "../../../.storybook/decorators/storyDialog"; | ||
import Usage from "../usage.mdx"; | ||
import CardNewsCoffee from "./CardNewsCoffee"; | ||
|
||
const meta = { | ||
title: "Card/News/Coffee", | ||
component: CardNewsCoffee, | ||
parameters: { | ||
layout: "centered", | ||
githubUsername: "wwasuu", // (optional) Your github username. If provided, your avatar will be displayed in the story toolbar | ||
}, | ||
decorators: [storyDialog(Usage)], | ||
} satisfies Meta<typeof CardNewsCoffee>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Coffee: Story = { | ||
render: () => ( | ||
<div | ||
style={{ | ||
width: 340, | ||
padding: 20, | ||
maxWidth: "100%", | ||
resize: "horizontal", | ||
overflow: "auto", | ||
}} | ||
> | ||
<CardNewsCoffee /> | ||
</div> | ||
), | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from "react"; | ||
import AspectRatio from "@mui/joy/AspectRatio"; | ||
import Avatar from "@mui/joy/Avatar"; | ||
import Box from "@mui/joy/Box"; | ||
import Card from "@mui/joy/Card"; | ||
import CardContent from "@mui/joy/CardContent"; | ||
import Link from "@mui/joy/Link"; | ||
import Typography from "@mui/joy/Typography"; | ||
|
||
export default function CardNewsCoffee() { | ||
return <Card> | ||
<AspectRatio | ||
sx={{ | ||
borderBottomLeftRadius: "var(--Card-radius)", | ||
borderBottomRightRadius: "var(--Card-radius)", | ||
}} | ||
> | ||
<img src="https://images.squarespace-cdn.com/content/v1/574ca6dac2ea517f706dfb89/e3978b8b-a830-4510-bc80-7132f933b270/xviiizz-3b_tjW24pDk-unsplash.jpg?format=1500w" /> | ||
</AspectRatio> | ||
<CardContent> | ||
<Typography level="h4" component="h2"> | ||
<Link href="#" overlay underline="none" textColor="inherit"> | ||
How to make perfect morning coffee, according to the Science | ||
</Link> | ||
</Typography> | ||
</CardContent> | ||
<CardContent orientation="horizontal" sx={{ alignItems: "center" }}> | ||
<Avatar src="https://i.pravatar.cc/300?img=1" /> | ||
<Box> | ||
<Typography fontWeight="lg"> | ||
Tara Gibson | ||
</Typography> | ||
<Typography level="body-sm" textColor="text.tertiary"> | ||
Jul 13, 2019 | ||
</Typography> | ||
</Box> | ||
</CardContent> | ||
</Card> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as CardNewsCoffee } from "./CardNewsCoffee"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Meta, Source } from "@storybook/blocks"; | ||
import raw from "./src/CardNewsCoffee?raw"; | ||
|
||
<Meta title="Card/News/Coffee" /> | ||
|
||
## CLI | ||
|
||
```sh | ||
npx joy-treasury@latest clone card-news-coffee | ||
``` | ||
|
||
## CardNewsCoffee | ||
|
||
<Source code={raw} language="tsx" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters