Skip to content

Commit

Permalink
Improve Reader and Player Stories
Browse files Browse the repository at this point in the history
Add descriptions for `identifier` and `orderId` and make the fields editable.
  • Loading branch information
kasperbirch1 committed Jan 7, 2025
1 parent f7cd0ef commit 6535e57
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
17 changes: 12 additions & 5 deletions src/components/reader-player/Player.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import Player from "./Player";

Expand All @@ -7,10 +6,14 @@ const meta: Meta<typeof Player> = {
component: Player,
argTypes: {
identifier: {
control: { type: "text" }
control: { type: "text" },
description:
"Publizon identifier for a material (Do not use both identifier and orderId)"
},
orderId: {
control: { type: "text" }
control: { type: "text" },
description:
"Place order id for a allready ordered material (Do not use both identifier and orderId)"
}
}
};
Expand All @@ -20,10 +23,14 @@ export default meta;
type Story = StoryObj<typeof Player>;

export const WithIdentifier: Story = {
render: () => <Player identifier="9788702366600" />
args: {
identifier: "9788702366600"
}
};

// Works only if the matrial is reserved
export const WithOrderId: Story = {
render: () => <Player orderId="" />
args: {
orderId: ""
}
};
17 changes: 12 additions & 5 deletions src/components/reader-player/Reader.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import Reader from "./Reader";

Expand All @@ -7,10 +6,14 @@ const meta: Meta<typeof Reader> = {
component: Reader,
argTypes: {
identifier: {
control: { type: "text" }
control: { type: "text" },
description:
"Publizon identifier for a material (Do not use both identifier and orderid)"
},
orderid: {
control: { type: "text" }
control: { type: "text" },
description:
"Place order id for a allready ordered material (Do not use both identifier and orderid)"
}
}
};
Expand All @@ -20,10 +23,14 @@ export default meta;
type Story = StoryObj<typeof Reader>;

export const WithIdentifier: Story = {
render: () => <Reader identifier="9788793681095" />
args: {
identifier: "9788793681095"
}
};

// Works only if the matrial is reserved
export const WithOrderId: Story = {
render: () => <Reader orderid="97cb3a6f-e23b-41ad-97ca-e939541feba7" />
args: {
orderid: ""
}
};

0 comments on commit 6535e57

Please sign in to comment.