Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcorner committed Feb 22, 2024
1 parent 61b7a4b commit ac23134
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/LoadErrorMessage/LoadErrorMessage.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, StoryFn } from "@storybook/react";
import { Meta, StoryFn, StoryObj } from "@storybook/react";

import LoadErrorMessage from "./LoadErrorMessage";
import { LoadErrorMessageProps } from "./LoadErrorMessage.types";
Expand All @@ -8,6 +8,11 @@ import React from "react";
* Story metadata
*/
const meta: Meta<typeof LoadErrorMessage> = {
argTypes: {
onButtonClick: {
control: false
}
},
component: LoadErrorMessage,
title: "Card/LoadErrorMessage"
};
Expand All @@ -18,8 +23,11 @@ const Template: StoryFn<LoadErrorMessageProps> = args => {
return <LoadErrorMessage {...args} />;
};

// Story type
type Story = StoryObj<typeof LoadErrorMessage>;

// Default
export const Default = {
export const Default: Story = {
args: {
contactTeam: "Support",
image: "virto-thinking",
Expand All @@ -30,7 +38,7 @@ export const Default = {
};

// HTTP 404
export const HTTP404 = {
export const HTTP404: Story = {
args: {
...Default.args,
actionButtonText: "Go back",
Expand All @@ -44,7 +52,7 @@ export const HTTP404 = {
};

// HTTP 401
export const HTTP401 = {
export const HTTP401: Story = {
args: {
...Default.args,
actionButtonText: undefined,
Expand All @@ -57,15 +65,15 @@ export const HTTP401 = {
};

// General Error
export const GeneralError = {
export const GeneralError: Story = {
args: {
...Default.args,
actionButtonText: "Refresh",
contactUrl: "https://support.virto.com",
errorDetails: "Invalid token - length is 0",
image: "virto-head-scratching",
message:
"Oops! Something went wrong on our end 😓 Our team is actively addressing it and working to resolve the issue. Please try again later.",
contactUrl: "https://support.virto.com",
title: "Something is not right!"
},
render: Template
Expand Down

0 comments on commit ac23134

Please sign in to comment.